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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 2

| accettato

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

oltre 8 anni fa | 1

| accettato

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 1

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

oltre 8 anni fa | 1

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

oltre 8 anni fa | 0

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

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

oltre 8 anni fa | 0

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

oltre 8 anni fa | 0

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

oltre 8 anni fa | 0

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

oltre 8 anni fa | 1

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

oltre 8 anni fa | 1

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

oltre 8 anni fa | 1

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

oltre 8 anni fa | 4

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

oltre 8 anni fa | 1

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

oltre 8 anni fa | 1

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

oltre 8 anni fa | 2

| accettato

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

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

oltre 8 anni fa | 2

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

| accettato

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

oltre 8 anni fa | 0

Carica altro