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

7 years ago | 3

| accepted

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

7 years ago | 0

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.

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

is there any way to did not show the grid of pcolor plot？
I think you should try: grid off after you call _pcolor_

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 1

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_

7 years ago | 1

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

7 years ago | 1

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

7 years ago | 0

grabbing number after decimal
N = 1234.5; R = 10*(N-floor(N)) R = 5

7 years ago | 1

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

7 years ago | 2

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

How I will get the integer number from a decimal number in vbscript
>> floor(11.45) ans = 11

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

matrix or array composed by zero-values
try with any(all(M)) any(all(M)) = 0 when every element of M equals 0

7 years ago | 0

How to view an image from the side?
Take a look at the built-in function _view_: help view doc view

7 years ago | 0

| accepted