Answered
Iteratively wants to change column while reading MS-Excel sheet
I recommend to use xlsread just once to retrieve all your data. They will already be stored in a neat cell structure ready to be...

7 years ago | 0

| accepted

Answered
How can I give user defined Yes No for multiple set of code?
a=input('Do you like triangles? Y/N','s'); if strcmpi(a,'y') %triangles elseif strcmpi(a,'n') %no trian...

7 years ago | 1

| accepted

Answered
why i cannot genereate the answer?
I agree with Stephen and Guillaume that else if should be elseif instead. I'd like to point out that there is another problem...

7 years ago | 0

Answered
How do i use a pair of nested for loops to store a series of 9 related numbers in a 3x3 matrix?
I hope i got the question right (some possible solutions with increasing number of loops): %no loop a=1; b=1;...

7 years ago | 0

Answered
how to sum a vector without sum function
If the only requirement is to not use _sum_, i'd like to suggest to use _cumsum_ instead! A=cumsum(StrengthVector); ...

7 years ago | 1

Answered
Recreating a figure from its handle after it has been closed
You can change the CloseRequestFcn of your figure to turn your figure invisible rather than closing it. As long as you keep your...

7 years ago | 0

Answered
problem with coding cumsum statement
Your data are stored as cells, not as matrix. Your values are also strings and need to be cast to numbers first. This code might...

7 years ago | 0

| accepted

Answered
Create a GUI (which aim to show and change a list of variables) dynamically based on the number of variables
As Stephen already pointed out this becomes way easier if you index your structure. %creating 'Variables' Variables(1).v...

7 years ago | 1

| accepted

Answered
I want to have a sequence of vectors using the following loop. but when i run the mat lab it will say "Subscripted assignment dimension mismatch." what can i do to index vectors and matrix.
There are a few errors in your code: # You try to assign 3 values [1 4 6] to only one field in x. This will not work unless x...

7 years ago | 0

Answered
For Loop Moving Through Array
You overwrite A in every iteration and you are calculating the same value over and over again (not using N anywhere). I am no...

7 years ago | 1

Answered
Export to Excel from MATLAB GUIDE GUI (user defines filename and directory)
Every function has its own workspace. Your function does not know x_data, y_data, accel_data and velocity_data. There are severa...

7 years ago | 0

Answered
why not it work between 1 and 10?
I think it is unlikely, that one number is smaller than 1 and bigger than 10 at the same time. num = input('enter a number ...

7 years ago | 1

Answered
Help needed with the program
As Kalyan Acharjya has already shown the actual error is a wrong parenthesis. if(M == 1 && D ==1) || (M == 7 && D == 4...

7 years ago | 0

| accepted

Answered
Matrix dimensions must agree error
I hope i understood your code right, this might help: t = sample.VarName1; X = sample.VarName2; indexOfComments = fin...

7 years ago | 0

| accepted

Answered
Writing key presses and time point of presses to file
This should work for numbers and letters, avoid space,cr,tab ... It also overwrites your old file if you don't change the fil...

7 years ago | 0

Answered
How to fix error index exceeds matrix dimensions. I am very new to matlab and am trying to write a loop for this data set but I keep getting this error. Any help would be appreciated!
You remove rows of Data, thus its size is shrinking during your loop. One way to resolve this is removing those rows after your ...

7 years ago | 0

| accepted

Answered
I want only one value stored in this code
Does v actually contain negative values? Else every value in s will be greater 4 after it exceeds this threshold for the first t...

7 years ago | 0

| accepted

Answered
App Designer: How to open a second GUI or a new window with panels, lamps, edit fields, etc. by a ButtonPush callback ?
You can create a 2nd app with appdesigner and call it from your first app. Your callback should look like this: function b...

7 years ago | 4

| accepted

Answered
Matlab jumps over my if-statement in my GUI even if the value is true?
Matlab is case-sensitive: If, Else, End, Setappdata, Isempty will not work - use if, else, end, setappdata, isempty instead.

7 years ago | 0

Answered
Updating 'Base' workspace values using a GUI
Here is an example how you can achieve what you asked for, however if you decribe what you want to do we probably come up with a...

7 years ago | 0

Answered
force stop condition in a loop
You can use <https://de.mathworks.com/help/matlab/ref/oncleanup.html onCleanup>.Minimal exampel: mytest() function mytes...

7 years ago | 1

Answered
Problem 10 of MATLAB cody challenge
There are a few problems with your solution: # You need to return true/false - not as string # You compare values to be bigg...

7 years ago | 0

| accepted

Solved


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

7 years ago

Answered
Making STOP - Button
It is hard to guess why it _doesn't work_ without seeing any actual code. Your GUI is not frozen while your loop is running. ...

7 years ago | 2

| accepted

Answered
Subscripted assignment dimension mismatch.
You need to pay attention when using size. Even if your data is a vector size will return 2 values unless you specify a dimensio...

7 years ago | 0

Answered
color a cell excel using matlab
Actually your code looks good despite a small typo. Excel = actxserver('excel.application'); % ^ capita...

7 years ago | 4

| accepted

Answered
Key press counter not updating
Do you want to press a button or a key on your keyboard? It is both easy to achieve, but not clear to me which one you want. You...

7 years ago | 0

Answered
I have created a GUI to take some data from user and save this input in EXCEL file, but every time when user inputs the data and hits submit button the data is overwritten.
I don't have much time to test right now. This might work: sizes = get(handles.size,'value'); switch sizes ...

7 years ago | 0

Answered
Closing figs but keeping variables for later use
Yes, you can use setappdata/getappdata. Does not work is a rather weak describtion of the problem, without knowing what the p...

7 years ago | 0

Load more