Answered
Matrix manipulation: split matrix in vectors
A(:)

12 years ago | 0

| accepted

Answered
when I load a mat file, it shows" unable to read file, no such file or directory"
Check if your file is in the current folder dir your_file_name.mat

12 years ago | 3

Answered
problem in find a simulink block
Probably, because this block is made by someone, contact the person who did this model

12 years ago | 0

Answered
Window that sets the file path missing
Restore default layout desktop = com.mathworks.mde.desk.MLDesktop.getInstance; desktop.restoreLayout('Default')

12 years ago | 1

| accepted

Answered
How can I start my axis from 0 but keep the max limit automatic?
ylim([0 inf])

12 years ago | 5

| accepted

Answered
convert binary to charaacter
str='10110001' c='ACTG' b={'00','01','10','11'} ss=regexp(str,'.{2}','match') [ii,jj]=ismember(ss,b) out=c(jj) %or ...

12 years ago | 0

Answered
How to import a transfer function from workspace into simulink?
Use <http://www.mathworks.com/help/simulink/slref/set_param.html set_param> function <http://www.mathworks.com/matlabcentral/...

12 years ago | 2

| accepted

Answered
xlswrite to create file with xlsx extension
xlswrite('file.xls',Your_data)

12 years ago | 0

| accepted

Answered
Create dummy variables from elements of a cell
X={'c1' 'c2' 'c3' 'c4' 'c5' 'c6' 'c7' 'c8' 18 1 53.33 15.08 67 16 20601 1999 26 0 53.96 14.20 11 254 40406 1998 ...

12 years ago | 1

| accepted

Answered
How to simplify a code to remove a for loop and make it faster?
*Edit* a=4 C=rand(a^2); D=rand(1,a^2); B=sum(bsxfun(@times, C,D),2)

12 years ago | 0

Answered
Vectorization with a loop and repmat
n=5; k=3; x=(k:n)' idx=rem(bsxfun(@plus,(0:n-k)',(0:n-k)),n-k+1)+1 out=x(idx)

12 years ago | 0

Answered
Converting the format Row Column Value into matrix ?
A=[1 2 5 1 3 6 2 1 8 2 5 1 3 1 4 3 3 2] n=max(A(:,1)) m=max(A(:,2)) out=zeros(n,m) out(sub2i...

12 years ago | 0

Answered
How to eliminate the repeated number?
number= 1: 10; t=[1 3 5 7]; out=setdiff(number,t)

12 years ago | 0

| accepted

Answered
how to plot a two-dimensional heaviside function
x=0:1000; y=0:500; z=0:25; a=25*(heaviside(x-40)-heaviside(x-240)), b=(heaviside(y-40)-heaviside(y-160)); out=bsxfun(@tim...

12 years ago | 1

Answered
loop through a multi layered structure
Use structfun function

12 years ago | 0

Answered
how to do subtraction inside Structure
*Edit* a=struct('result',{1:5,1:7}) b=struct('result',num2cell(bsxfun(@minus,a(1).result',a(2).result)))

12 years ago | 1

Answered
how to convert decimal values into 8bit binary sequence and represent in a 256*256 matrix
a=imread('C:\Users\Abzz\Desktop\lena.png'); b=cell2mat(arrayfun(@(x) reshape(dec2bin(x,8)-'0',1,1,8),a,'un',0));

12 years ago | 0

Answered
How to conbine the array inside the structure?
struct1=struct('f1',num2cell(1:10)) struct2=struct('f2',num2cell(1:5)) new_struct=struct('new_f',num2cell([struct1.f1 struct...

12 years ago | 0

| accepted

Answered
Calculate how often a 1 turns into a 0 or 1, and vice versa
a = [1 1 1 0 1 0 0 1; 1 1 0 1 1 0 1 0] for k=1:size(a,1) out{1,k}=numel(strfind(a(k,:),[1,1])) out{2,k}=numel(s...

12 years ago | 0

Answered
uitable in report generator
The table is created but not saved. You need to add after *Eval* component , the *figure snapshot* component

12 years ago | 0

Answered
Undefined Function error (Undefined)
xe is used inside your function and can not be recognized even if it exist in the Matlab workspace. You need to declare it as i...

12 years ago | 0

| accepted

Answered
Making a list from two arrays
A = {'a' 'b' 'c' 'd'} B = [1 2 3 4] out='{' for k=1:numel(B) out=[out sprintf('%s->%d,',A{k},B(k))] end out(end)='}...

12 years ago | 1

| accepted

Answered
Scatter Plotting multiple graphs(x, y) on a single graph
scatter([X1,X2,X3,X4,X5],[Y1,Y2,Y3,Y4,Y5]) %or scatter(X1,Y1) hold on scatter(X2,Y2) scatter(X3,Y3) scatte...

12 years ago | 2

Answered
How to create an array of integers from a string
s='1:3, 10, 11' out=str2num(s) With eval it should be something like s='1:3, 10, 11' eval(strcat('out=[', s ,']'))...

12 years ago | 0

| accepted

Answered
Select parts of number from a cell of many numbers to put in a variable?
a=20140802 b=datevec(datenum(num2str(a),'yyyymmdd')) b(1) % is the year b(2) % the month b(3) % the day

12 years ago | 0

Answered
Extracting nth element of nested cell array
filenameSplit=cellfun(@(x) x{3},filenameSplit,'un',0)

12 years ago | 0

Answered
Substitute blank entries in a cell array by elements from a double matrix
A={13 1999 47.7 13 183 [] [] 0 141 1999 60.2 141 308 [] [] 0 174 1999 51.9 174 308 [] [] 0 181 1999 52...

12 years ago | 1

| accepted

Answered
How to shuffle some arrays of a matrix?
a=[1 2 3 4 5 6] n=2:5 idx=randperm(n(end)-n(1)+1)+n(1)-1 a(n)=a(idx)

12 years ago | 0

Answered
How to combine multiple nx1 size of matrix into one matrix
You mean concatenation [A;B] Read the documentation <http://www.mathworks.com/help/matlab/math/creating-and-concatenati...

12 years ago | 1

Answered
Get new variable based on a condition
M=[2008 1 1 2009 1 2 2010 1 34 1996 12 7 1997 12 11 1998 12 5 1999 12 5 2000...

12 years ago | 1

Load more