Answered

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

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

7 years ago | 1

| accepted

Answered

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','...

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','...

7 years ago | 6

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

| accepted

Answered

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.

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.

7 years ago | 1

| accepted

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 1

| accepted

Answered

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

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

7 years ago | 1

| accepted

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 1

| accepted

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 2

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

Answered

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

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

7 years ago | 0

| accepted

Answered

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

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

7 years ago | 0

Answered

form a row vector

First, get all the X+... and Y+... separately and get them into the correct order then (Activate the commented % to stop the out...

form a row vector

First, get all the X+... and Y+... separately and get them into the correct order then (Activate the commented % to stop the out...

7 years ago | 1

| accepted