Answered
GUI Errors on callback functions
Cua - you haven't posted what the errors are but I do think part of the problem is that the image isn't being properly saved to ...

4 månader ago | 0

Answered
Perserving a legend when running a script manually multiple times
Chay - how are you calling legend? Are you only passing a single label that you are hoping is applied to all plots? I think that...

4 månader ago | 0

Answered
Printing data results with Fprintf
azaandria - try replacing disp('Event #s won by Gymnast 2:'); disp(g2won); with disp('Event #s won by Gymnast 2:'); events...

4 månader ago | 0

| accepted

Answered
How could I code that if the user pushes “Q” then an X will be displayed the the coordinates (1,3)?
Eryn - you can use the following code to detect whether the Q (or q) button of the keyboard has been pressed function KeyboardL...

5 månader ago | 0

| accepted

Answered
increament in for loop does not working for impulse response
Tathagata - if the damping constant/factor is given by g, and you want to increment this value by 0.1 on each iteration of the l...

5 månader ago | 0

Answered
button can access audio files from computer device and display the audio graphic plot
Winda - in the push button callback, use uigetfile to allow the user to choose the audio file to load into the app. Once you hav...

5 månader ago | 0

| accepted

Answered
Repeat audio in App Designer
Mostafa - you could perhaps use a timer to periodically check the status of the audio player. If it isplaying then you would do ...

5 månader ago | 0

Answered
using the title of excel spreadhseets to name graphs
It may be possible to add a title using title if you specifiy which axes the title should be applied to. For example, your code ...

6 månader ago | 0

Answered
How to add multiple if statements
Jan - I think that you just need to add a couple of conditions to your if statement. You would need to check that the input is n...

6 månader ago | 0

| accepted

Answered
C CODE Generation - Why does my code not terminate?
HF - the code that you mention for (i = 0; i <= coffset; i++) { Xm0_data[i] = Xm0->data[(aoffset + 30 * i) - 1]; } occur...

6 månader ago | 0

Answered
Restart script when user says yes
Jake - you could try removing the while from the AnotherTeam function and put that in your main script. Suppose that AnotherTeam...

6 månader ago | 1

| accepted

Answered
Game of life code
Katara - if you wish to construct a random matrix of zeros and ones, then you could use randi as numRows = 10; numCols = 12; ...

6 månader ago | 0

Answered
How to add user inputs in a script?
Hdez - I think you want to convert your script into a function. See the link for details.

6 månader ago | 0

Answered
Increasing the figure size in GUI
hamzah - try using normalized units instead. See figure units for details.

6 månader ago | 0

Answered
Can't Stop program
ziv - I think the problem is that you are getting stuck in a loop between two functions: DrawBoard and GamePlay. DrawBoard calls...

6 månader ago | 0

Answered
bsxfun - @minus - how to divide by maximum
Ko - if you want to divide by the maximum of a, couldn't you just do out = abs(bsxfun(@minus,a,b')./max(a)) ?

7 månader ago | 0

Answered
how store multi image in on file ?
Rana - consider writing the images to a single tif file. Please see the example at Write Multiple Images to TIFF File.

7 månader ago | 0

Answered
creating new variable using for loop and if-else condition
Arturo - look closely at your conditions if age(n)==10 & age(n)<=29 The above would mean that nth element of the age array is ...

8 månader ago | 1

Answered
Converting a String to Double without str2double
Sanjin - why do you need to convert it using str2double? check=z(k); In the above check is a character so you could compare it...

8 månader ago | 1

| accepted

Answered
Plotting for a range of values
Verdan - in your code, the mB and a are scalars whereas you want them to be arrays (for when you plot outside of the loop). Try ...

8 månader ago | 1

Answered
Index exceeds the number of array elements (1)
The error is here k1=p(x1_rec(i),y1_rec(i),x2_rec(i),y2_rec(i)); l1=q(x1_rec(i),y1_rec(i),x2_rec(i),y2_rec(i)); where...

8 månader ago | 0

Answered
Fix axis on plot
Benjamin - I'm not entirely sure this is what you want, but I think that you need to find the minimum and maximum across all x a...

8 månader ago | 0

Answered
I'm keep having an error 'Not enough input arguments' for this code
Muhammed - from the function signature function [y] = DivisibleTest(M) when calling this function, you need to provide an inpu...

8 månader ago | 0

Answered
Can't reach line object from callback function - 'Invalid or deleted object.'
Fredrik - I suspect the problem is here guiobj.chkbox(k) = uicontrol('Parent',guiobj.f,'Style','checkbox','String',Names(k),...

8 månader ago | 0

| accepted

Answered
For - While loop output and extracting the value of computed rows from a column
Christopher - look closely at this code for qq = [1:5] while cumulative_sum <= C cumulative_sum = cumulative_sum ...

8 månader ago | 1

| accepted

Answered
confusion while; break; continue.
Blazhe - I think the condition on your while loop is preventing you from entering the body (of the loop) and so preventing the c...

8 månader ago | 0

| accepted

Answered
In a 'for loop' not getting difference of two consecutive iteration
feeroz - you never update your x, y, and z after their initialization, so perhaps you are intending to use X_i instead. Try the ...

8 månader ago | 0

| accepted

Answered
How do I use function for a function which has a matrix with variable index?
Fidele - since your function signature is function [a,b,c] = trial_function(num) then you need to assign values to each of th...

8 månader ago | 0

Answered
Calling a function in bisect.m
Rashi - try removing (in the hw7p2.m file) the @ in front of the function handle that you are passing into the bisect function....

9 månader ago | 0

| accepted

Answered
Animating a pendulum: error in code
In order to convert to a series of frames and save as an AVI, just do % open the video writer v = VideoWriter('pendulum.avi');...

9 månader ago | 0

Load more