Réponse apportée
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 ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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:...

plus de 8 ans il y a | 2

| A accepté

Réponse apportée
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);...

plus de 8 ans il y a | 1

| A accepté

Réponse apportée
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) ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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;...

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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 ...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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 * ...

plus de 8 ans il y a | 0

Réponse apportée
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-...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 0

Réponse apportée
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|.

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 1

Réponse apportée
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. ...

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 1

Réponse apportée
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...

plus de 8 ans il y a | 4

Réponse apportée
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. ...

plus de 8 ans il y a | 1

Réponse apportée
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);

plus de 8 ans il y a | 1

Réponse apportée
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 |...

plus de 8 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 8 ans il y a | 0

Réponse apportée
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...

plus de 8 ans il y a | 2

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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])

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 8 ans il y a | 0

| A accepté

Réponse apportée
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: ...

plus de 8 ans il y a | 0

Charger plus