Réponse apportée
Generate new array with logarithmic spacing
I'm not sure what you want. You can get a logspaced array like this: Assume that x is your xdata and you want the log array to h...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
how to calculate the area of different labels and remove the labels with smaller area??
CC is a struct including the field |PixelIdxList|. If you define the area as number of pixels, you just need the number of eleme...

presque 11 ans il y a | 1

| A accepté

Réponse apportée
How can I plot Months in x axis in Matlab
You can set the xticklabels: y=rand(1,12); figure, plot(y) set(gca,'xtick',1:12,... 'xticklabel',{'Jan','Feb','Mar','...

presque 11 ans il y a | 7

Réponse apportée
need to plot this question
Please... Did you ever write this into the Matlab editor? If so, you would see that the error is in the very first line - you ca...

presque 11 ans il y a | 0

Réponse apportée
Why are the variables declared in this WHILE loop not getting modified in the FOR loop?
Check line 11: if (i == (steps+1)) && ((locumx ~= 1) || (locumx ~= 0)) || ((locumy ~= 1) || (locumy ~= 0)) You have 5 c...

presque 11 ans il y a | 0

Réponse apportée
how to plot specific row to specific row?
Just transpose it: >> f=[1:10;11:20;21:30]; >> phase=1./f; >> figure, plot(f',phase') If the parameters for the p...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Matrix, Mean coloum 2, with a value in coloum 1 < 25
just: mean(M(M(:,1)<25,2)) The keyword here is logical indexing, btw. You can find good tutorials about it online.

presque 11 ans il y a | 1

| A accepté

Réponse apportée
How to read txt file in matlab
When I have this issue, I usually go this way: fid=fopen('test.txt'); txt=char(fread(fid)); fclose(fid); headerli...

presque 11 ans il y a | 0

Réponse apportée
help regarding indexing matrix in image processing
I think there are dozens of possibilities, I just thought about this particular one: if mod(size(m,1),2)==0 m=[m;n...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Extract number from a specified row in a text file
If the file size is this small and you don't have too many files to read, you can go with this very simple solution: keywo...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
How to XOR two cells from the same cell array?
With "cell", do you mean you have a cell array or do you refer to the elements of a normal logical array? I suppose second, then...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Lose of Precision when storing values
What do you mean, you loose precision? I guess you mean the numbers displayed in the command window, such as x=[1e7 1.1] ...

presque 11 ans il y a | 1

| A accepté

Réponse apportée
how to divide a picture into 25 pieces and display in one figure randomly?
One way: img=imread('test.jpg'); %read the image cimg=mat2cell(img(1:5*fix(end/5),1:5*fix(end/5),:),fix(size(img,1)/5)*...

presque 11 ans il y a | 1

| A accepté

Réponse apportée
column shuffling of a matrix
Please use the {}Code button to make your code readable. If this code is sorting the rows in the manner you want, you can ch...

presque 11 ans il y a | 0

Réponse apportée
How to represent RGB color information using matlab?
Images are represented by (m x n x 3) arrays. This is basically three two-dimensional arrays behind each other. The first layer ...

presque 11 ans il y a | 0

Réponse apportée
Insert a changing number into a variable in matlab?
You can use structure arrays for that: >> day(1).name='Monday'; >> day(1).start=9; >> day(2).name='Tuesday'; >> d...

presque 11 ans il y a | 0

Réponse apportée
How to reflect a graph
I guess you want something like this: >> x=1:10;y=x.^2.*rand(size(x)); >> figure, plot(x,y), hold all >> reflectionx=8;...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
How do I populate the next term in an If/elseif code?
Why should it not work to change it to N(i+1)=1? I'm wondering what's the desired output for timeStep between 35 and 40? ...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
What does this syntax/notation mean? En=[En sum(x(n-L+1:n).^2.*win(1:L)')];
|En=[En sum(...)];| is just extending En by one or more elements. Try: >> x=rand x = 0.2061 >> x=[x rand]...

presque 11 ans il y a | 1

| A accepté

Réponse apportée
Why this error using integral function?
Fun thing is I get a different error message: Error using / Matrix dimensions must agree. Anyway, if you chang...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
I have this small code. If statement fails to execute when x(i)<=10^0 say for 10^-5, 10^-1 or 10^0 even though matrix x contains the given elements
For the third time today, the answer is floating point arithmetics: >> [f,ind]=min(abs(x-.01)) f = 1.7347...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Buttons on top of bitmap?
You might find this contribution useful (if I remember correctly, you can rotate the string by 90°): http://de.mathworks.com...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
find function and vectors gives Empty matrix: 1-by-0
That's a floating point arithmetics problem. 0.1 cannot be represented exactly. Creating the array your way, you get something l...

presque 11 ans il y a | 2

Réponse apportée
num2str weird behavior with decimal input....
You already pointed to the correct reason with your comment. It's basically about floating point arithmeticts. >> [0.03*10...

presque 11 ans il y a | 0

Réponse apportée
how i read and display the .mha file?
The file mha_read_volume.m must either be in the current directory or be in one of the directories displayed when you enter |pat...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
How to see code of power_fftscope_pr
If you have the m file (power_fftscope_pr.m), you can enter >> type power_fftscope_pr and the code will be printed in th...

presque 11 ans il y a | 0

Réponse apportée
plotting x vs y data ?
Sorry, I got a bit confused by the description of the problem. You want to plot this part of the file, right? Year Jan Feb...

presque 11 ans il y a | 0

Réponse apportée
How can I extract orientation of arrows from quiver function?
quiver actually _plots_ the information. quiver(x,y,u,v) means arrows are drawn pointing in (u/v) direction and positio...

presque 11 ans il y a | 0

Réponse apportée
Resolution of a MATLAB-created JPG
In case you include the information about the resolution, you can get it via imfinfo (see e.g. http://www.mathworks.com/matlabce...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Exclude matrix diagonal in for loop
In case you cannot vectorize the problem, why don't you simply check for equality? for cnt1 = 1:20 for cnt2=1:20 ...

presque 11 ans il y a | 0

Charger plus