Answered

Form an image of vertical ramp having a ramp values from 0 to 255 and dimension 256x256.

I suppose you want a ramp horizontally, since you only want values from 0-255 in a 256x256 matrix. Filled with integers. X=...

Form an image of vertical ramp having a ramp values from 0 to 255 and dimension 256x256.

I suppose you want a ramp horizontally, since you only want values from 0-255 in a 256x256 matrix. Filled with integers. X=...

4 years ago | 2

Answered

gui interface and variables

The structure to use _popupmenu_ is something like this function popupmenu1_Callback(hObject, eventdata, handles) opti...

gui interface and variables

The structure to use _popupmenu_ is something like this function popupmenu1_Callback(hObject, eventdata, handles) opti...

4 years ago | 1

| accepted

Answered

Reading .txt file of values separated by semicolon

C = textscan(fileName, '%s','Delimiter',';')

Reading .txt file of values separated by semicolon

C = textscan(fileName, '%s','Delimiter',';')

4 years ago | 1

| accepted

Answered

imshow 16 bit tif file turns to black

I think that it happends because your tif image is a grayscale image are it's said in properties. Maps are used for colour image...

imshow 16 bit tif file turns to black

I think that it happends because your tif image is a grayscale image are it's said in properties. Maps are used for colour image...

4 years ago | 2

| accepted

Answered

Matlab's 'VariableNames' not accepting mix of numerical & non-numerical entries

It does not accept it because it has spaces and not because it has alphanumeric characters. It will allow this, for example: ...

Matlab's 'VariableNames' not accepting mix of numerical & non-numerical entries

It does not accept it because it has spaces and not because it has alphanumeric characters. It will allow this, for example: ...

4 years ago | 0

| accepted

Answered

Converting Mat file to Dicom file

for image_num = 1:320 dicomwrite(img(1:512,1:512,image_num),FILENAME); sprintf('Reconimg%s.dcm',num2str(image_nu...

Converting Mat file to Dicom file

for image_num = 1:320 dicomwrite(img(1:512,1:512,image_num),FILENAME); sprintf('Reconimg%s.dcm',num2str(image_nu...

4 years ago | 0

Answered

Finding the median of a vector without using the median tool in matlab?

All the code is fine, except for the last line. A=rand(1,51); Z=sort(A); n=length(Z); t=(n+1)/2; med=(Z(floor(t))+Z(cei...

Finding the median of a vector without using the median tool in matlab?

All the code is fine, except for the last line. A=rand(1,51); Z=sort(A); n=length(Z); t=(n+1)/2; med=(Z(floor(t))+Z(cei...

4 years ago | 1

Answered

How would I add an extra dimension to an already existing matrix?

try this C=randi([-10,10],4,4); C(:,:,2)=C; Which creates a new layer of C matrix to create a 3D array

How would I add an extra dimension to an already existing matrix?

try this C=randi([-10,10],4,4); C(:,:,2)=C; Which creates a new layer of C matrix to create a 3D array

4 years ago | 0

Answered

How to make a 2D plot of a function with an additional parameter, which I can change "live"?

there is option to link plot when you open _figure_ for example: C=0; x=1:1:100; y=x+1; plot(x,y) then enable plo...

How to make a 2D plot of a function with an additional parameter, which I can change "live"?

there is option to link plot when you open _figure_ for example: C=0; x=1:1:100; y=x+1; plot(x,y) then enable plo...

4 years ago | 2

Answered

How would I create an even and odd matrix within a specific range?

Like this lower=32; upper=44; A=lower+2:2:upper; B=lower+1:2:upper; result=[A;B]

How would I create an even and odd matrix within a specific range?

Like this lower=32; upper=44; A=lower+2:2:upper; B=lower+1:2:upper; result=[A;B]

4 years ago | 0

Answered

Save new name in file .mat and loop new name

You mean, how to save each BWAREA variable in a different file using a loop when you have variables that follow a pattern? try ...

Save new name in file .mat and loop new name

You mean, how to save each BWAREA variable in a different file using a loop when you have variables that follow a pattern? try ...

4 years ago | 0

Answered

high altitude balloon prediction.

Well, Matlab is a powerfull tool for complex mathematical operations. Also, there are so many functions and toolboxes you can ta...

high altitude balloon prediction.

Well, Matlab is a powerfull tool for complex mathematical operations. Also, there are so many functions and toolboxes you can ta...

4 years ago | 0

Answered

How to find index of closest value in a column array for every value in another column array.

You can adapt this according to your needs. you just have to use loops to make a serires of comparations. Also you have to kn...

How to find index of closest value in a column array for every value in another column array.

You can adapt this according to your needs. you just have to use loops to make a serires of comparations. Also you have to kn...

4 years ago | 0

Answered

Is it possible to form a matrix with strings and manipulate them?

Try this, it's using cell arrays. However I believe that in the newest versions of matlab cell arrys that include Sting work in ...

Is it possible to form a matrix with strings and manipulate them?

Try this, it's using cell arrays. However I believe that in the newest versions of matlab cell arrys that include Sting work in ...

4 years ago | 1

| accepted

Answered

Want to convert .MAT to .TXT

Here is quick way to do that. Using fprint as @Adam says. (This writes with 5 decimal places) X=[1.90; 2.3]; Y=[2.5467;10....

Want to convert .MAT to .TXT

Here is quick way to do that. Using fprint as @Adam says. (This writes with 5 decimal places) X=[1.90; 2.3]; Y=[2.5467;10....

4 years ago | 0

Answered

Is there a way to create a directory called 'aux' ?

Yes, that word is part of windows legacy. The following reserved device names cannot be used as the name of a file: *CON, PRN...

Is there a way to create a directory called 'aux' ?

Yes, that word is part of windows legacy. The following reserved device names cannot be used as the name of a file: *CON, PRN...

4 years ago | 2

| accepted

Answered

While loop inside another While loop (While in While)

I don't think there is a problem with the loops by themselves. You must have a problem with the logic, can you show the code you...

While loop inside another While loop (While in While)

I don't think there is a problem with the loops by themselves. You must have a problem with the logic, can you show the code you...

4 years ago | 3

Answered

I want to go to a particular page in a 100 pages pdf file using a push button in matlab GUI. What command should I use in the push button callback function?

The command to do that is: system("Acrobat directory" /A "page=20" "your file directory"); Do it as if you were doing it ...

I want to go to a particular page in a 100 pages pdf file using a push button in matlab GUI. What command should I use in the push button callback function?

The command to do that is: system("Acrobat directory" /A "page=20" "your file directory"); Do it as if you were doing it ...

4 years ago | 1

| accepted

Answered

How can i solve this equation ?

If you want to get multiple answers use _vpasolve_ function. Set the number of answers you want yo get and the code will pick so...

How can i solve this equation ?

If you want to get multiple answers use _vpasolve_ function. Set the number of answers you want yo get and the code will pick so...

4 years ago | 0

| accepted

Answered

Hello, I have two matrices of different sizes and I want to find the indices for the elements in the bigger matrix that match with those in the smaller one, allowing for repetition?

Hello Alaa, I believe the way to do it is just comparing array A with each element of B using _find_ function. There must be a s...

Hello, I have two matrices of different sizes and I want to find the indices for the elements in the bigger matrix that match with those in the smaller one, allowing for repetition?

Hello Alaa, I believe the way to do it is just comparing array A with each element of B using _find_ function. There must be a s...

4 years ago | 0

Answered

How to choose option using radio buttons?

You mean you want to get an outcome from the radiobutton clicking? *Radiobutton 1 Callback* %% function radiobutton...

How to choose option using radio buttons?

You mean you want to get an outcome from the radiobutton clicking? *Radiobutton 1 Callback* %% function radiobutton...

4 years ago | 1

| accepted

Answered

how can i sum over to variable in matlab?

you mean something like this.... I'm supposing F,K,G are random arrays, are N and N' independent values??? because the no...

how can i sum over to variable in matlab?

you mean something like this.... I'm supposing F,K,G are random arrays, are N and N' independent values??? because the no...

4 years ago | 0

Answered

Adding new values in between existing values in an array

use the _linspace_ function to add the values inbetween the array, also use an auxiliary variable. Maybe try this code. %% ...

Adding new values in between existing values in an array

use the _linspace_ function to add the values inbetween the array, also use an auxiliary variable. Maybe try this code. %% ...

4 years ago | 1

Answered

How do I use a vector to change the color of multiple panels in the GUI interface?

I dont understand exactly what are you trying to do, one way to change the colour of the objects in the GUI is this. <</matla...

How do I use a vector to change the color of multiple panels in the GUI interface?

I dont understand exactly what are you trying to do, one way to change the colour of the objects in the GUI is this. <</matla...

4 years ago | 1

Answered

How can i solve this equation ?

Just use the function solve, which uses numerical techniques to find variables. try this. %% syms lambda Mt=1; % Th...

How can i solve this equation ?

Just use the function solve, which uses numerical techniques to find variables. try this. %% syms lambda Mt=1; % Th...

4 years ago | 0

Answered

How to calculate mean and variance?

Since you want to do it without using the functions, just do: A=rand(1000,1); %your array sum1=0; for i=1:length(A)...

How to calculate mean and variance?

Since you want to do it without using the functions, just do: A=rand(1000,1); %your array sum1=0; for i=1:length(A)...

4 years ago | 3

| accepted

Question

Problem with dicomwrite pixel values

I've been working on a project where I use the DICOM write function to save my files after procesing, values of my matrix go fro...

4 years ago | 0 answers | 0

Answered

Const char into mex files

I solved it by myself. If anyone is in trouble with this the answer is given in this page http://www.mathworks.com/help/ma...

Const char into mex files

I solved it by myself. If anyone is in trouble with this the answer is given in this page http://www.mathworks.com/help/ma...

4 years ago | 1

| accepted

Question

Const char into mex files

Hello, I'd like to know how can I export my Matlab strings to use them whitin a MEX file, as it follows. I'm quite new using ...

4 years ago | 1 answer | 0