Answered
Working with structs & excel spreadsheets
You need to call xlsread at each iteration in order to read a new sheets. XlsFile = 'YourXlsFile.xlsx'; % get the na...

11 years ago | 0

| accepted

Answered
??? Error using ==> fscanf. Invalid file identifier. Use fopen to generate a valid file identifier.
Hi Lorenzo, You're trying to read a file named literally file = 'C:\Temporal_series\list_exam[i]\run1\list_ROI[j]'; t...

11 years ago | 0

Answered
How to access a workspace variable (or structure) by a symbolic mask parameter?
Not sure to get you problem. You want to create a masked block and Initialize it with a script ? Something like ? <...

11 years ago | 0

Answered
How to read an ascii text file and extract the data in a matlab
A classic way to read text files is by using <http://www.mathworks.fr/help/matlab/ref/textscan.html _textscan_>. or just with...

11 years ago | 0

Answered
how can i do this?
Hey, Just do : % amplitude Lmaks = 10; % coordinates vectors theta = [-180 -120 -60 0 60 120 180]; ...

11 years ago | 1

Answered
Approximating Euler's sum using while loop
the line Error = Error -(100*abs((exact - sum)/exact)); is wrong. Replace it with Error = 100*abs((exact - sum...

11 years ago | 0

| accepted

Answered
How to find the sum and average of an array w/o sum and mean command using fprintf?
WIthout built-in command sum and mean? What the point to use Matlab then ? Anyway, you just need to implement some basic algo...

11 years ago | 1

Answered
Switching cases in simulink
Not exactly, the clock block outputs the current running time when you simulate a model. (0, 0.01, 0.02,... if you simulate i...

11 years ago | 0

| accepted

Answered
Read colomn data from file
Hi, try this FileId = fopen('b.txt'); DataCell = textscan(FileId, '%.8f','Delimiter','\n', 'HeaderLines', 39); fclose...

11 years ago | 0

Answered
Why do I get errors when simply opening a .fig file generated by GUIDE?
Alexei, When you create a GUI with GUIDE, you always have two files generated untitled.m % script untitled.fig % figu...

11 years ago | 1

Answered
Delate the xlabeltick of the worldmap
my bad, I pasted the wrong code. you need two lines h=worldmap([-2 89.9],[-180 180]); setm(h,'mapprojection','giso','f...

11 years ago | 1

| accepted

Answered
Delate the xlabeltick of the worldmap
to make the y and x tick invisibles set(findall(h,'Tag',{'PLabel','MLabel'}),'visible','off') and actually, these ar...

11 years ago | 0

Answered
How to change 4x4 matrix to 2x2 matrix
A = [1 2 3 4; 2 3 4 5; 3 4 5 6; 4 5 6 7] B = cellfun(@mean,cellfun(@mean,mat2cell(A,[2 2],[2 2]),'UniformOutput...

11 years ago | 1

Answered
Trying to find root of equation with fzero command in Matlab.
that seems more logic for me. use the syntax for using an extraparameter to your function. % here's an example from the ...

11 years ago | 0

Answered
Plotting 3D points from numerous arrays
I don't have data to work with and see the validity of the result, but I guess you need something like % create array by co...

11 years ago | 0

Answered
Trying to find root of equation with fzero command in Matlab.
Why is T a vector ? usually, fzero is used to solve an equation to find one scalar solution.

11 years ago | 0

Answered
how to observe the output of digital filter?
Amrutha, you should explicit your post. What is the error message ? (we can't guess it). Usually, in simulink, you jus...

11 years ago | 0

Answered
how to convert fields of a struct into numbered matrices
Hi, you can create variables using _eval_ % create the variable N1,...,N5 for i = 1:5 eval(['N' num2str(i) '=r...

11 years ago | 1

| accepted

Answered
Sine wave changing amplitude
Sure you can. a sine wave is defined by y = A*sin(w*t+phi). if you define A as a function(vector) dependant of the time...

11 years ago | 0

Answered
Por que ocorre esse erro: Error using vertcat Dimensions of matrices being concatenated are not consistent. Preciso gerar uma imagem de um animal.
you seriously should consider to write in english. also use the *_{}code_* button to format your code. your error is in th...

11 years ago | 0

Answered
Determining what type of data is in my array
use isnan A=[1 2 3 nan 5]; isnan(A) ans = 0 0 0 1 0 see also _isfloat_ and _c...

11 years ago | 2

Answered
Help generating a triangle using arrays, rotating triangle
I haven't done things like that for a long time. always fun. see the attached file and adapt it.

11 years ago | 0

Answered
Loading multiple .mat files by using for loop
the line _files = dir('dataset*_1.mat');_ returns dataset1_1, dataset2_1,... not what you want. then files2 = d...

11 years ago | 0

| accepted

Answered
Switching cases in simulink
just use a switch and 2 transfer functions <</matlabcentral/answers/uploaded_files/20615/switch.png>>

11 years ago | 0

Answered
Running time in Simulink
Your modeling seems good. But did you think to change the configuration of the solver ? By default, a simulink model is in...

11 years ago | 0

Answered
How can I find column number of a specific element in matrix?
I guess you meant three element in a vector (you can make the same operation on a matrix) ex : vec = [5 3 9]; ...

11 years ago | 0

Answered
how can i plot the arrows like in the targeted phase-plane portraits at the initial points?
Hi, Modifying your script _phase_plane_example5_, you could do something something like clear clc X = []; Y = ...

11 years ago | 0

Answered
Help generating a triangle using arrays, rotating triangle
You misused _linspace_. x = linspace(0,2,0.1); will return an empty matrix, same for y. and then you concatenate two emp...

11 years ago | 0

Answered
How to find index of first 3 maximum number in matrix
use the second output argument of _sort_ m = [7;1;4;4;12;2;6;10;2]; [temp,originalpos] = sort( m, 'descend' ); n ...

11 years ago | 5

| accepted

Answered
How to keep lines on a changing plot ?
use the hold function S.a_axe = axes(); hold on; for i=1:10 plot(i*sin(0:0.01:10)); end by default matlab...

11 years ago | 0

Load more