Answered
cell contents assignment to a non-cell array object
I suspect your should have looked something like this (note the commented lines and the comments) %IM = imread('C:\Program ...

8 years ago | 1

Answered
How to add "weight" to a 3D matrix
If you simply want to calculate |Area=c*h-2*b*a| for every combination of a, b, and c, the code below does that. If that is not ...

8 years ago | 0

| accepted

Answered
Colon-generated arrays with or without brackets
The reason for this is the unexpected order in which this statement is evaluated: [1:3]' + 1:3 ([1:3]' + 1):3 ([1;2;3...

8 years ago | 0

| accepted

Answered
yyaxis plot joining start and end points with a straight line
Because I don't have your data I can't check this, but it might be the case that your data is not well-sorted, so |plot| results...

8 years ago | 0

| accepted

Answered
Real time plot slows down due to hold on command
You are adding many lines to a plot, of course at some point that will slow down your computer. A solution would indeed be to ha...

8 years ago | 0

| accepted

Answered
How should I fix my while loop so that "Index exceeds matrix dimensions." ? Below is my script
In my example below I hardcoded |fr| and |gu|. Although I agree with Birdman about pre-allocation, that is not the only problem:...

8 years ago | 2

| accepted

Answered
how to save dynamic file name
You shouldn't pass |fname| as a string, but as a variable: fname = sprintf('./Output/THOutput/LHS%d/GMID%dForce.mat', i,k);...

8 years ago | 1

| accepted

Answered
How to I put the real numbers on the y axis of a bar chart without an exponent
A simple typo: you should have written |YAxis| testvalues=[10000 12340 32100 42190]; figure(1),clf(1) subplot(1,2,1) ...

8 years ago | 0

| accepted

Answered
Stop xlsread from trimming last empty cells
You can always do it with the dirty hack below values = xlsread(file, sheet, 'O9:O12'); if length(values)<4,values(4)=0;...

8 years ago | 1

Answered
numColumns Property in legend
For those not on R2018a, there is a FEX submission that should provide the same functionality: <https://www.mathworks.com/matlab...

8 years ago | 1

Answered
change legend line segment width in version 2018
The style of the legend item is inherited from the object itself, so you can make the line thicker, but only if you make the lin...

8 years ago | 0

Answered
How can I swith between plots in the same plot window?
You can plot all the lines and toggle the visibility with the |KeyPressFcn| of the figure, which sets the |Visible| property of ...

8 years ago | 0

| accepted

Answered
could anyone tell me how to group the combinations under the condition that the same number should not be repeated again.
The code below is the same as the code by KSSV, but without the need for implicit expansion. c = combnk(1:4,2); N = c * ...

8 years ago | 0

Answered
Deleting row and column with all zeros and putting it back
B={[-17.5310+20.7302i 0.0000+0.0000i 5.4364-2.0952i 0.0000+0.0000i 0.0000+0.0000i 0.0000+0.0000i 5.4364-...

8 years ago | 0

Answered
how do I get the datafeed GUI?
Apparently datafeed is currently a <https://www.mathworks.com/products/datafeed.html toolbox>, which is sold separately. I don't...

8 years ago | 0

Answered
Waitbar minimum progress increment too high
You could round up to the next 3% after the first loop, or create a function yourself that works on a pixel basis with |image|.

8 years ago | 0

Answered
multiple contours from a given polygon
It looks like you're actually looking for something that can be achieved by <https://www.mathworks.com/help/releases/R2017b/imag...

8 years ago | 1

Answered
How can i solve the vertcat error.
If you want to write something to 1 cell in an Excel file, you probably mean to concatenate to a row instead of column-wise. ...

8 years ago | 1

Answered
legend entry for geometric object in matlab plot
You can use the handle to the |patch| object that |fill| returns. h=fill([1 1 0 0],[0 1 1 0],'r'); axis([-0.5 1.5 -0.5 1...

8 years ago | 1

Answered
How to remove daily data and leave the last day of each month
Assuming you have R2014b or later, the code below should extract the logical vector that is true for every last day of the month...

8 years ago | 4

Answered
Index exceeds Matrix Dimensions
Your code fails on the last loop: it tries to reach |index(i+1)|, but |i| is equal to the length of |index| on the last loop. ...

8 years ago | 1

Answered
Using nested for loop to alter a previous matrix
Is this homework? If not, why not avoid a loop: A =1:25; A2=reshape(A,5,5);

8 years ago | 1

Answered
Question about matrix ????
|z=2^a;| is a <https://en.wikipedia.org/wiki/Matrix_exponential matrix exponentiation> and |x=a&b;| is an element-wise logical |...

8 years ago | 2

| accepted

Answered
help me finding this error
The problem is that this line temp = find(cumsum(ant_transit_prob)>=rand(1), 1); sometimes returns an empty vector. I do...

8 years ago | 0

| accepted

Answered
whay latex cant edit colour
Putting the color specifier at the beginning of the string should work, except that it doesn't seem to work with math mode. You ...

8 years ago | 0

Answered
why is my plot shows nothing?
Because the command you are using has an incorrect syntax. You can't enter two input arguments to |sqrt|. Also, you first dec...

8 years ago | 2

Answered
load a file with gui and use it on another callback
You forgot to save the variables to the struct and to save the struct back to |guidata| at the end of your browser2 callback, an...

8 years ago | 0

| accepted

Answered
Hi can any one help me to show how to use window +level setting in matlab?
You can use the |caxis| function: window=40;level=20; caxis([level-window/2 level+window/2])

8 years ago | 0

| accepted

Answered
How do I calculate the number of combinations for a random 2*5 matrix?
There are only 1024 different matrices, so you could loop through them all, but I think a theoretical approach is better. For...

8 years ago | 0

| accepted

Answered
How to pass data in a gui and refresh/reload a list box
You can set the output from |fieldnames| as the |String| property of the listbox. You can use indexing with the |Value| property...

8 years ago | 0

| accepted

Load more