Answered

Saving a structure to Excel

Try this out (adapt it to your need) a.b.c.d = rand(16,1); a.b.c.e = rand(16,1); my_last_field = fieldnames(a.b.c);...

Saving a structure to Excel

Try this out (adapt it to your need) a.b.c.d = rand(16,1); a.b.c.e = rand(16,1); my_last_field = fieldnames(a.b.c);...

5 years ago | 3

| accepted

Answered

Saving a structure to Excel

take a look at this linK: <http://www.mathworks.com/matlabcentral/answers/13069-export-to-excel> Where is clearly stated: ...

Saving a structure to Excel

take a look at this linK: <http://www.mathworks.com/matlabcentral/answers/13069-export-to-excel> Where is clearly stated: ...

5 years ago | 0

Answered

How to open a gui fig file from another gui?

If what you want to do is open another GUI, call its associated *.m, not the *.fig.

How to open a gui fig file from another gui?

If what you want to do is open another GUI, call its associated *.m, not the *.fig.

5 years ago | 1

| accepted

Answered

display 4 consecutive numbers in array

a= [9 10 11 12 17 18 19 20 23 24]; for k=1:(length(a)-3) % k=2 if a(k:k+3)==(a(k):a(k)+3) fprintf('re...

display 4 consecutive numbers in array

a= [9 10 11 12 17 18 19 20 23 24]; for k=1:(length(a)-3) % k=2 if a(k:k+3)==(a(k):a(k)+3) fprintf('re...

5 years ago | 0

Answered

Calling a function within another function?

Just call them from within _tictactoe_: In your _tictactoe_ function: function your_outputs = tictactoe(your_inputs) ...

Calling a function within another function?

Just call them from within _tictactoe_: In your _tictactoe_ function: function your_outputs = tictactoe(your_inputs) ...

6 years ago | 0

Answered

how to process equation in summation

Tl = 0; % initilization of summation alphaNs = 2; for k = 01:alphaNs Tl = Tl + abs(x(k)^2); end Tl = (1/alp...

how to process equation in summation

Tl = 0; % initilization of summation alphaNs = 2; for k = 01:alphaNs Tl = Tl + abs(x(k)^2); end Tl = (1/alp...

6 years ago | 0

| accepted

Answered

graphing my first PDE

take a look at the documentation. doc pdepe will present a very good example. This same example is explained in more de...

graphing my first PDE

take a look at the documentation. doc pdepe will present a very good example. This same example is explained in more de...

6 years ago | 0

Answered

How to output a value of an array for a specific value of time?

idx = find(t==1); v(idx) or in a single line: v( find(t==1) )

How to output a value of an array for a specific value of time?

idx = find(t==1); v(idx) or in a single line: v( find(t==1) )

6 years ago | 0

Answered

is there any way to did not show the grid of pcolor plot？

I think you should try: grid off after you call _pcolor_

is there any way to did not show the grid of pcolor plot？

I think you should try: grid off after you call _pcolor_

6 years ago | 0

Answered

symbolic integration with undefined variable

Point out that z>0 like this: >> assume(z>0); >> b=int(a, r, 0, r) b = -2*pi^2*z*(log(z) - log(r + (r^2 ...

symbolic integration with undefined variable

Point out that z>0 like this: >> assume(z>0); >> b=int(a, r, 0, r) b = -2*pi^2*z*(log(z) - log(r + (r^2 ...

6 years ago | 1

| accepted

Answered

low speed of 'ismember' function

Depending on your data, you might try to code your own function avoiding some conditions and calls to sub-functions within the _...

low speed of 'ismember' function

Depending on your data, you might try to code your own function avoiding some conditions and calls to sub-functions within the _...

6 years ago | 0

Answered

Plot an strange equation

10.75-8.5567 ans = 2.1933 Then: my_equation = '2.1933-158.34.*y+2112.07.*y.^2-12211.07.*y.^3-29.44.*...

Plot an strange equation

10.75-8.5567 ans = 2.1933 Then: my_equation = '2.1933-158.34.*y+2112.07.*y.^2-12211.07.*y.^3-29.44.*...

6 years ago | 0

| accepted

Answered

How do you calculate the volume of tumor from a series of MRI slices contaning tumor

You have to know the scale of the images. Once you know the scale (equivalence between pixel-size and mm, for example), you j...

How do you calculate the volume of tumor from a series of MRI slices contaning tumor

You have to know the scale of the images. Once you know the scale (equivalence between pixel-size and mm, for example), you j...

6 years ago | 0

| accepted

Answered

Indexing matrix to get corresponding values for condition,store in a new matrix each time?

It is not very clear what you want, but I think it has to be something like this: sat_look_tcs=[sat_elev;sat_azim;range]; ...

Indexing matrix to get corresponding values for condition,store in a new matrix each time?

It is not very clear what you want, but I think it has to be something like this: sat_look_tcs=[sat_elev;sat_azim;range]; ...

6 years ago | 0

Answered

How to print result in MATLAB?

define your _Name_ array as a cell, then: Name={'ABC-8' 'S8' 'EG8'}; Thick=[25 16 12]; Z =cell(numel(Name),1); for...

How to print result in MATLAB?

define your _Name_ array as a cell, then: Name={'ABC-8' 'S8' 'EG8'}; Thick=[25 16 12]; Z =cell(numel(Name),1); for...

6 years ago | 1

Answered

Why the trigonometry results are different

The different result between tan(90) and tan(pi/2) is obvious. 1.6331e+16 might be considered equal to _inf_

Why the trigonometry results are different

The different result between tan(90) and tan(pi/2) is obvious. 1.6331e+16 might be considered equal to _inf_

6 years ago | 1

Answered

Problem in string-number concatenation

Define your _A_ array as a cell using brackets _{_ _}_: A={'E';'F';'G';'H';'I';'J';'K';'L';'M';'N';'O';'P';'Q';'R';'...

Problem in string-number concatenation

Define your _A_ array as a cell using brackets _{_ _}_: A={'E';'F';'G';'H';'I';'J';'K';'L';'M';'N';'O';'P';'Q';'R';'...

6 years ago | 1

Answered

combining variables into one variable

your_Combination = zeros(28,125,121); % initialize the final variable Now you have several options depending on your data: ...

combining variables into one variable

your_Combination = zeros(28,125,121); % initialize the final variable Now you have several options depending on your data: ...

6 years ago | 0

Answered

Reflect a triangle given a mirror line

Create a m-file with this function: function S = symetric_P_about_line(P,m,n) % line of symmetry: y = m*x + n; Md...

Reflect a triangle given a mirror line

Create a m-file with this function: function S = symetric_P_about_line(P,m,n) % line of symmetry: y = m*x + n; Md...

6 years ago | 1

| accepted

Answered

HOW TO ENCODE AN 8BIT VALUE FROM A MATRIX

M=randint(256,256,[0,256]); disp(N) N=zeros(size(M)); for k=1:256 for l=1:256 N(k,l) = str2double(d...

HOW TO ENCODE AN 8BIT VALUE FROM A MATRIX

M=randint(256,256,[0,256]); disp(N) N=zeros(size(M)); for k=1:256 for l=1:256 N(k,l) = str2double(d...

6 years ago | 0

Answered

Wrong equastion of XY dependence

Instead of your definition of _x_, try the folowing one: x= -5:.01:15; % array of 2001 elements, your definition were a mer...

Wrong equastion of XY dependence

Instead of your definition of _x_, try the folowing one: x= -5:.01:15; % array of 2001 elements, your definition were a mer...

6 years ago | 0

Answered

how can i put a label for columns in an array?

x=[1 5 8 0 6 1]; C=cell(2,length(x)); for k=1:length(x) C{1,k} = sprintf('x%g',k); C{2,k} = x(k); e...

how can i put a label for columns in an array?

x=[1 5 8 0 6 1]; C=cell(2,length(x)); for k=1:length(x) C{1,k} = sprintf('x%g',k); C{2,k} = x(k); e...

6 years ago | 0

Answered

Error: File: hh.m Line: 148 Column: 1 Function definitions are not permitted in this context.

You have to save your functions in a different m-file and then make the call to them from your script. Matlab does not allow min...

Error: File: hh.m Line: 148 Column: 1 Function definitions are not permitted in this context.

You have to save your functions in a different m-file and then make the call to them from your script. Matlab does not allow min...

6 years ago | 0

Answered

How I will get the integer number from a decimal number in vbscript

>> floor(11.45) ans = 11

How I will get the integer number from a decimal number in vbscript

>> floor(11.45) ans = 11

6 years ago | 0

Answered

How to find the difference between two files?

A good way to compare two files in Matlab is to select them in the current folder (use Ctrl button to select your files), then r...

How to find the difference between two files?

A good way to compare two files in Matlab is to select them in the current folder (use Ctrl button to select your files), then r...

6 years ago | 0

Answered

How to run m-file from another m-file by input string

I do that some times just by doing this: another_script = input('script name: ','s'); % and type the name of your other scr...

How to run m-file from another m-file by input string

I do that some times just by doing this: another_script = input('script name: ','s'); % and type the name of your other scr...

6 years ago | 0

Answered

matrix or array composed by zero-values

try with any(all(M)) any(all(M)) = 0 when every element of M equals 0

matrix or array composed by zero-values

try with any(all(M)) any(all(M)) = 0 when every element of M equals 0

6 years ago | 0

Answered

How to view an image from the side?

Take a look at the built-in function _view_: help view doc view

How to view an image from the side?

Take a look at the built-in function _view_: help view doc view

6 years ago | 0

| accepted

Answered

If else if statement problem

You can solve the issue rounding the value of _c_: %Problem occurs here, if c = 1, else statement is displayed instead e...

If else if statement problem

You can solve the issue rounding the value of _c_: %Problem occurs here, if c = 1, else statement is displayed instead e...

6 years ago | 1

| accepted