Answered
How to store results of for loop in 1D array.
goal = 1000000; needMoreMoney = true; age = 30; savings = 10000; inheritence = randi(10,1,1); rateOfReturn = (-3 + (12 - ...

13 years ago | 0

Answered
Plotting graph in matlab
x=0:0.1:10 y = exp(0.5*x).*sin(x) plot(x,y)

13 years ago | 1

| accepted

Answered
Scientific notation to decimal?
a=1.0418e+06 out=sprintf('%10.2f',a)

13 years ago | 2

Answered
problem using fprintf for writing cell data and global data at the same time.
cellArray={'p.4004' 'p.4005' 'p.4007'} matrix=[1 2 3;4 5 6;7 8 9] v=[cellArray num2cell(matrix)]...

13 years ago | 0

| accepted

Answered
Concatenating data from a variable within a MAT file in a loop
new = [new;a_i.delta_length] % Use also sprintf to generate fileA,fileB,... new=[]; s='A':'C' for i=1:3 a_i=[lo...

13 years ago | 0

| accepted

Answered
problem using fprintf for writing matrix into microsoft office word.
fileID = fopen('fic.txt', 'w'); fprintf(fileID,'%.15f %.15f \n',matrix') fclose(fileID)

13 years ago | 0

| accepted

Answered
Running this problem an error occurs: ??? Error using ==> rem Not enough input arguments.
Type and show the result which rem Or check in your current folder if there is a function named rem

13 years ago | 0

Answered
opening a fig in different directory
When you want to use any file you have to specify the name of the file and its location. example folder='E:\matlab' filena...

13 years ago | 0

| accepted

Answered
change current directory in gui
Why do you need to change the current directory? If you want to save a file in a folder of your choice,type folder='E:\mat...

13 years ago | 0

Answered
give the matrix a name
Why do you want to create a name for each matrix, put them all in one cell array Example M{1}=[1 2;3 4] M{2}=[5 6;7 8] ...

13 years ago | 1

Answered
Makeing two vectors dimentionaly equal, while retaining the info...
Another way *Edit* n=max(numel(x),numel(y)); idx=[islogical(x) islogical(y)]; v=[zeros(1,n);1:n]; x(end+1:n)=v(idx,n...

13 years ago | 0

Answered
Makeing two vectors dimentionaly equal, while retaining the info...
x = [1 2 3 4 5 6 7 8] y = logical([0 0 0 1 1 1 0 0 1 1 0 0 1]) nx=numel(x); ny=numel(y); ix=islogical(x); iy=islogical(y)...

13 years ago | 0

| accepted

Answered
need to copy value from one matrix (short) into another matrix (long) such that it repeats multiple times
[~,~,c]=unique(long(:,1)); long=[long short_demo(c,4)]

13 years ago | 0

| accepted

Answered
How to plot 3D discrete data with vectors x,y and matrix Z?
stem3(x,y,z,'linestyle','none')

13 years ago | 0

Answered
How to define objects from a cell-array table in Matlab
clear Objects= {'Name ' 'weight' 'height' 'lengthth' 'depth' 'Parts' 'motor Motor1' 100 120 180 ...

13 years ago | 0

| accepted

Answered
How to give two inputs to a state space system in simulink?
Pass you two step signals through a <http://www.mathworks.com/help/simulink/slref/mux.html Mux block>

13 years ago | 3

| accepted

Answered
Sampling time must agree
Have you changed the sample time or not yet?

13 years ago | 0

Answered
How to customize the answer of Matlab in advance?
a=[2 ,4, 6, 7, 1, 5, 3 ] idx=find(a==1) out=circshift(a, [0 -idx+1])

13 years ago | 0

Answered
How to customize the answer of Matlab in advance?
a_input=[1 2 3 4 5] a_output=[2 5 4 1 3] a_output(a_output==4)=[]; a_output=[4 a_output]

13 years ago | 0

Answered
Consolidating row values from previous column duplicate values.
[a,b,c]=unique(A(:,1:2),'rows','stable') out=[a accumarray(c,A(:,3))]

13 years ago | 1

Answered
can i write simple for loop in the command window
for k=1:3;a(k)=k^2;end %or for k=1:3,... a(k)=k^2,... end

13 years ago | 1

Answered
How to plot intermediate variables of a function used by ode45 solver:
In your code Te represent 2*x, then why you don't just type Te=2*x(:,2)

13 years ago | 0

Answered
How do I convert a piece of music in .mp3 format to a .mat format?
Use <http://www.mathworks.com/help/matlab/ref/audioread.html audioread function> [y,fs]=audioread('youfile.mp3'); save new...

13 years ago | 1

Answered
create a signal for a specified duration
Use three blocks # Prod block to multiply the two below blocks # random number block with |sample time set to 0.5| # repeat...

13 years ago | 0

| accepted

Answered
Generate random coordinates around a circle
x0=10; % x0 an y0 center coordinates y0=20; radius=10; % radius angle=-pi:0.1:pi; angl=angle(randperm(numel(angle),15))...

13 years ago | 1

Answered
Generate random coordinates around a circle
x0=10; % x0 and y0 are center coordinates y0=20; r=1; % radius angle=-pi:0.1:pi; angl=angle(randi(numel(angle),15,1)) ...

13 years ago | 0

Answered
create arrays in a loop
This is not a good idea, why create multiple variables while you can use just one cell array. Look at <http://matlab.wikia.com/w...

13 years ago | 0

Answered
How to apply If else Condition in simulink?
Look at <http://www.mathworks.com/help/simulink/slref/if.html>

13 years ago | 0

Load more