Answered
Create Structure Fields with and Array of Strings
help cell2struct And a place to learn struct. <http://blogs.mathworks.com/loren/category/structures/> However, your data is be...

14 years ago | 0

Answered
Best shap for data to be in to work on.
It looks to be a good use case for dataset(). See doc dataset. Also see this blog. <http://blogs.mathworks.com/loren/2009/05/...

14 years ago | 0

Answered
indices and values
%% [I,J,V]=textread('test.txt','(%f,%f) %f'); A=zeros(2,3); A(sub2ind(size(A),I,J))=V

14 years ago | 0

Answered
Singleton dimention as last dimension in matrix
Unless you have further process need, there is really no need to do that. >> size(rand(10)) ans = 10 10 >> ...

14 years ago | 4

Answered
how can i know which toolbox a function is calling?
try depfun()?

14 years ago | 0

Answered
inverse loop
for i=180:-1:1 for j=180:-1:1

14 years ago | 7

Answered
Simulink 'From Workspace' and 'To workspace' elements
You need to check the simulation step size of your Simulink model. The "From Workspace" block specifies a signal with time-value...

14 years ago | 0

Answered
storing words
I am not sure if you follow your own question. There is a much easier way to do this. <http://www.mathworks.com/matlabcentral...

14 years ago | 0

Answered
Manipulate Matrix Element using subscripts (ex: isprime(i-j)) or (i+j)>10)
%% n=10; A=zeros(n); A(isprime(abs(bsxfun(@minus,(1:n)',1:n))))=1

14 years ago | 0

| accepted

Answered
Running simulation a specified number of times
Put sim('MyModel') inside your for-loop.

14 years ago | 1

Answered
dlmread
Check the help of dlmread(). I believe the range [R1, C1, R2, C2] won't allow negative number. use fullfile() instead of strc...

14 years ago | 0

| accepted

Answered
Linking data points
The way you did, every time it just plots one point (fit,y(i)). Pre-allocate two vectors before the for-loop N=20; y=zeros...

14 years ago | 0

Answered
short and sweet simple question
NewS=S(x)

14 years ago | 1

| accepted

Answered
What is the location of the file from where the GUI of a toolbox in MATLAB is launched?
To find out the location of a file, run which wavemenu which wavemenu.fig -all

14 years ago | 1

| accepted

Answered
Reading last lines in a text file
Your data are numerical so I think it's better to read them as numerical data. %% fid = fopen('HCl.txt','rt'); A = textsc...

14 years ago | 0

| accepted

Answered
Geting Info.
<http://www.mathworks.com/products/matlab-coder/?s_cid=global_nav>

14 years ago | 0

Answered
finding root using false position method
Do a plot to find out the curve. If you put the right initial value, it could solve the problem. ezplot(f) x0=-6 x1=6 ...

14 years ago | 0

| accepted

Answered
Comparing sets of data
x=round(rand(10,1)); y=1:10; index=x==0; y(index)=0;

14 years ago | 0

| accepted

Answered
Looping output values back as input
InputValue=1; for k=1:NumberOfIteration OutputValue=MyFunction(InputValue); InputValue=MyFunction(OutputV...

14 years ago | 0

Answered
Pseudo Noise Sequence
rand()? for k=1:3 rand('seed',k); a=rand(1,5) end The generated random numbers will be repeatable.

14 years ago | 0

Answered
First order system
If you have the transfer function or state space matrix of the system, you can use *dcgain()* to get the gain. If you have jus...

14 years ago | 0

| accepted

Answered
time on x axis
can you try to skip the "set(gca,'XTick',xData)" line and use the default xtick set by plot()?

14 years ago | 0

| accepted

Answered
How to extract cell array in matlab
%% c={'22.11.2011 13:58:56.16','22.11.2011 13:58:40.16'}; d=datevec(c); floor(d(:,6))

14 years ago | 1

| accepted

Answered
How to generate a 3d Spline curve can interp3 be of help
Put the matrix you show in the variable d, are you trying to plot using plot3()? plot3(d(:,1),d(:,2),d(:,3)); grid on;

14 years ago | 0

Answered
Array of struct manipulating
%% construct a structure array M=3; s=struct('a',repmat({1},M,1),'b',repmat({2},M,1),'c',repmat({3},M,1)); %proce...

14 years ago | 0

Answered
Index cell where number jumps
A=[1 2 3 4 5 6 20 21 22 23 24 25 60 61 62 63 64 65] B=diff(A) find(B>1)

14 years ago | 1

| accepted

Answered
excel dates
Use [Num,Txt,Raw]=xlsread() and then "Raw" will keep the "hh:mm" string format, then you can use datenum() to convert it. If th...

14 years ago | 0

| accepted

Answered
(Simulink) Passing a string from the mask to a block
String data type is supported for Simulink blocks, see Simulink->Model-Wide Utilities->Block Support Table. But you can use stri...

14 years ago | 0

Answered
Reading a text file
I recommend Jan's approach because it puts string into sting and numerical to numerical. But if you want it, you can use reshape...

14 years ago | 1

| accepted

Answered
writing a code involving struct
For fun, just take all the text from TMW website and sort them according to the first letter and then put them into a word bank....

14 years ago | 0

Load more