Respondida
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 ...

más de 8 años hace | 0

| aceptada

Respondida
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...

más de 8 años hace | 0

| aceptada

Respondida
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...

más de 8 años hace | 0

| aceptada

Respondida
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...

más de 8 años hace | 0

| aceptada

Respondida
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:...

más de 8 años hace | 2

| aceptada

Respondida
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);...

más de 8 años hace | 1

| aceptada

Respondida
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) ...

más de 8 años hace | 0

| aceptada

Respondida
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;...

más de 8 años hace | 1

Respondida
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...

más de 8 años hace | 1

Respondida
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...

más de 8 años hace | 0

Respondida
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 ...

más de 8 años hace | 0

| aceptada

Respondida
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 * ...

más de 8 años hace | 0

Respondida
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-...

más de 8 años hace | 0

Respondida
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...

más de 8 años hace | 0

Respondida
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|.

más de 8 años hace | 0

Respondida
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...

más de 8 años hace | 1

Respondida
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. ...

más de 8 años hace | 1

Respondida
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...

más de 8 años hace | 1

Respondida
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...

más de 8 años hace | 4

Respondida
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. ...

más de 8 años hace | 1

Respondida
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);

más de 8 años hace | 1

Respondida
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 |...

más de 8 años hace | 2

| aceptada

Respondida
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...

más de 8 años hace | 0

| aceptada

Respondida
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 ...

más de 8 años hace | 0

Respondida
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...

más de 8 años hace | 2

Respondida
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...

más de 8 años hace | 0

| aceptada

Respondida
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])

más de 8 años hace | 0

| aceptada

Respondida
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...

más de 8 años hace | 0

| aceptada

Respondida
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...

más de 8 años hace | 0

| aceptada

Respondida
Storing multiple values of output in one variable
You forgot to index |f| in your loop. %your code: for i =1:1:10; f = y*p(i)/(1+y); end %working code: ...

más de 8 años hace | 0

Cargar más