Answered
randn() function generates the same sequence whenever I called it.
Use rng function for k=1:10 rng(k) randn(1,10) end

10 years ago | 0

| accepted

Answered
How to select a submatrix from a bigger one?
idx=input('choose your 15 columns') M=A(:,idx)

10 years ago | 0

Answered
How I plot 3d graph of known x,y,z ?
z= [ 2220.6 0 0 0 0 1160.4 1106.3 0 0 0 806.9 0 734.86...

10 years ago | 0

Answered
Plotting N days values in N Y axes
If you want multiple plot in one axis use hold on doc hold

10 years ago | 0

Answered
how to ask the User to inform elements to compose a matrix
I think it always gives error. b=4 Neuron = zeros(1,b-1) ; for jj=1:b-1 p = input ('enter the number of the neur...

10 years ago | 0

Answered
how to get a smaller matrix from a larger matrix?
A(1:8,1:8) After reading the <http://www.mathworks.com/help/matlab/matrices-and-arrays.html documentation>, you don't need ...

10 years ago | 4

| accepted

Answered
cell array and each individual element in it
repmat({zeros(1,4)},6,6)

10 years ago | 0

Answered
Is there a way to run editor and simulink side by side
You can <http://www.mathworks.com/help/simulink/slref/matlabfunction.html Matlab function block>

10 years ago | 0

Answered
How can I rotate my x axes made by words?
If you are using version of Matlab after 2014b set(gca,'xticklabelrotation',45) If you haven't the latest version of Mat...

10 years ago | 0

| accepted

Answered
Not able to write the binary data into the text file
student_id=66438; a=dec2bin(student_id,16) studID = fopen('D:\stid.txt','wb'); fprintf(studID,'%s',a) fclose(studID)

10 years ago | 0

Answered
log and Exponential Equations: logb^300=30, find b)
syms b sol=solve(log(b^300)==30)

10 years ago | 0

Answered
The usage of find in matlab for finding the length of repeated element
In your case find is not doing the job, your code doesn't give the expected result x=[1 1 1 2 2]; index=[find(x(1:end-1) ~...

10 years ago | 1

Answered
I wanna create vector of structures
ii=1:10 vec=struct('a',num2cell(ii),'b',num2cell(20-ii),'c',num2cell(ii+3))

10 years ago | 1

Answered
Finding minimum value between certain rows
idx= [diff(A(:,3)')==0 0]; ii2=find(idx==0); ii1=[1 ii2(1:end-1)+1]; B=zeros(numel(ii1),size(A,2)); C=zeros(numel(ii1),2);...

10 years ago | 0

| accepted

Answered
Why is cell2mat returning a char array and not an ordinary array?
Kim what is an ordinary array? array of string doesn't exist in Matlab. s={'ab' 'cd';'er','mh'} cell2mat(s) Result ...

10 years ago | 0

| accepted

Answered
How to adjust GUI to fit screens of varying resolution
Get the screen size screensize = get( 0, 'Screensize' )

10 years ago | 0

Answered
Unable to display symbolic expression
Try to display the first element of Test.t1 Test.t1(1) Output truncated. Text exceeds maximum line length of 25 000...

10 years ago | 0

Answered
[a,b]=[1,2] why does not work? How I correct it?
d={1 2}; [a,b]=d{:}

10 years ago | 0

Answered
Line chart from 3D data at a fixed point
A=rand(296,301,648); %Example time=1:648; y=squeeze(A(250,250,:)) plot(time,y)

10 years ago | 0

| accepted

Answered
how to compare the values of two matrix??
id=isequal(A,B)+1 str={'different matrices','equal matrices'}; str{id}

10 years ago | 0

| accepted

Answered
How to transform the below quadrant plot in to a semicircle plot?
fill([-1 1 1 -1 ],[0 0 1 1 ],'b') hold on w=0:0.1:pi x=cos(w) y=sin(w) plot(x,y,'w','linewidth',6) h=area(x,y,'facecolor...

10 years ago | 0

| accepted

Answered
Keep plots results for several function calls
Use hold on. doc hold

10 years ago | 0

| accepted

Answered
How to convert an image file to text file & display the text file ?
imgHex=cellstr(imgHex) fid = fopen('im16_1.txt', 'wt'); fprintf(fid, '%s\r\n', imgHex{:}); fclose(fid)

10 years ago | 0

Answered
Discrete Transfer function numerator/denum values from Workspace and HDL code generation
assigning values to your block parameters directly in the block or in the workspace is the same thing

10 years ago | 1

Answered
how to count non zero elements in a vector and replace this values based on the count values
v= [0 0 0 0.1 0.2 0.3 0.4 0.5 0 0 0 0 0 0 0.1 0.2] idx=[0 v~=0 0] idx1=strfind(idx,[0 1]) idx2=strfind(idx,[1 0])-1 id=idx...

10 years ago | 0

| accepted

Answered
Finding peaks only in signal
[peak,idx]=findpeaks(YourSignal,'minpeakwidth',1000)

10 years ago | 0

Answered
for loop vectorization using cells
s=arrayfun(@(x) randi(9,36,1),1:10,'un',0) %Example locCOR=sum(cell2mat(s),2)

10 years ago | 0

| accepted

Answered
How to xlswrite cell array with both strings and number?
A={'''01:02:03'};

10 years ago | 0

| accepted

Answered
save and load command give error
Change the folder where you want to save your file. Choose for example documents

10 years ago | 0

Answered
How to load a cell array which contains both strings and numbers to matlab?
For Excel file use xlsread function [num,text,both]=xlsread('FileName')

10 years ago | 0

| accepted

Load more