답변 있음
How do I change the axis things get plotted on?
Nick - you need to specify the axes as described at create line on axes. In your case, you might want to save the axes handle to...

5달 전 | 0

| 수락됨

답변 있음
Make a function loop
Eris - if you want to keep rolling until you have a Yatzhee, then you probably want to use a while loop. % set the roll count ...

5달 전 | 0

답변 있음
blackjack adding another number to a vector in a while loop & input words for a if loop
Liam - since you are asking the user to enter in the command to "stand" or "hit", then you should be using the strcmpi to compar...

5달 전 | 0

| 수락됨

답변 있음
while creating figure based app in MATLAB, how to give callback to another matlab code?
Ashwini - yes, you should be able to use your other MATLAB code depending upon how it is written. You will want it to be a funct...

5달 전 | 0

답변 있음
User selected points from a plot
Kyle - from https://www.mathworks.com/matlabcentral/answers/11439-selecting-data-from-a-plot-in-a-gui, there is an answer that s...

6달 전 | 0

| 수락됨

답변 있음
How do I specify a variable from a table that uses words and not numerical values
Elias - try using strcmp or the case-insensitive strcmpi.

6달 전 | 0

답변 있음
matlab Invalid expression error
Jakub - try adding a semi-colon after title(['t = ', num2str(t)]); so that it is distinct from the axis square; Or write e...

6달 전 | 0

답변 있음
Preserve Name of Indexed Variable for columns when creating a Table
TS - you can set the variable names when you create the table T = table(Time(1:50,:),Data(1:50,:),Etc(1:50,:), 'VariableNames',...

6달 전 | 0

답변 있음
not enough input arguments error
sudheer - if you are calling this function from the command line (or another piece of code) as simply trans then you will get ...

6달 전 | 0

답변 있음
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 ...

6달 전 | 0

답변 있음
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...

6달 전 | 0

답변 있음
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...

6달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 0

| 수락됨

답변 있음
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...

7달 전 | 0

답변 있음
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...

7달 전 | 0

| 수락됨

답변 있음
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 ...

7달 전 | 0

답변 있음
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 ...

8달 전 | 0

답변 있음
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...

8달 전 | 0

| 수락됨

답변 있음
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...

8달 전 | 0

답변 있음
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...

8달 전 | 1

| 수락됨

답변 있음
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; ...

8달 전 | 0

답변 있음
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.

8달 전 | 0

답변 있음
Increasing the figure size in GUI
hamzah - try using normalized units instead. See figure units for details.

8달 전 | 0

답변 있음
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...

8달 전 | 0

답변 있음
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)) ?

9달 전 | 0

답변 있음
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.

9달 전 | 0

답변 있음
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 ...

10달 전 | 1

답변 있음
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...

10달 전 | 1

| 수락됨

답변 있음
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 ...

10달 전 | 1

답변 있음
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...

10달 전 | 0

더로드