Answered
Extracting data from .mat file and then adding up results to form a new .mat file
If A is your matrix, you can get one column with reshape function B=reshape(A',[],1) In your question, I don't know wha...

10 years ago | 0

| accepted

Answered
How to convert date variable with varying length?
You have to indicate the format of your data. Suppose your data are like below: d=[12988 112589 52214] e=arrayfun(@(x)...

10 years ago | 0

Answered
why this command is not work
Use plot not Plot

10 years ago | 0

Answered
How to generate a square wave from arbitrary binary numbers?
a=dec2bin(randi(2^6-1,1,10)) b=a' c=str2num(b(:)) f=10^5; T=1/f; t=0:T:(numel(c)-1)*T; stairs(t,c,'r','linewidth',2)

10 years ago | 2

Answered
Matlab changes XAXIS order
x=[ 6 7 8 9 10 11 12 1 2 3 4 5 ] y=sin(x) x1=1:numel(x) plot(x1,y) set(gca,'xtick',x1,'xticklabel',x)

10 years ago | 0

| accepted

Answered
How convert cell array inside a cell array in a string with date and time format ?
F='Daily_cum_2013_05_30_09_59__2013_05_31_10_05__2013_05_31_10_08' a=F(11:end) b=regexp(a,'__','split') out1=cellfun(@(x) d...

10 years ago | 0

| accepted

Answered
Using unique command in a matrix
A=[1 2 3 3 3 5 6 11 14 16 16 16 14 16] B=unique(A','rows')' Or maybe you wan...

10 years ago | 0

Answered
Num2str error
You get this error if you try to use num2str with a cell format s={'123'} out=num2str(s) s should be a number s=12...

10 years ago | 0

| accepted

Answered
Simulink from file block
read the help <http://www.mathworks.com/help/simulink/slref/fromfile.html> your data should be stored as a Matrix or as timeser...

10 years ago | 0

Answered
How to filter only numerical in a table?
s={'1966.csv' '1967.csv' '1968.csv' '1969.csv' '1970.csv' '1971.csv' '1972.csv' '1973.csv' '1974.csv' '1975.csv'} out=cellfun...

10 years ago | 0

| accepted

Answered
Reading time and dates from Excel
Use datenum function

10 years ago | 0

| accepted

Answered
Defining length of a x-axis
xlim([x1 x2]) ylim([y1 y2])

10 years ago | 0

Answered
Fix the trace in the plot
Get ride of the last point in your plot

10 years ago | 0

Answered
How can I view the files inside a directory in workspace or browser of matlab ?
Restore the default layout desktop = com.mathworks.mde.desk.MLDesktop.getInstance; desktop.restoreLayout('Default')

10 years ago | 0

| accepted

Answered
how can i find same values in an array?
[ii,jj,kk]=unique(a,'stable')

10 years ago | 0

Answered
Selecting an element from each column of a matrix using another matrix
%Example A= randi(10,5,6) B =randi(5,1,6) %--------------------- [n,m]=size(A); idx=B+(0:n:n*(m-1)) out=A(idx)

10 years ago | 0

Answered
Duplicate a Simulink module
You can use <http://www.mathworks.com/help/simulink/slref/add_block.html add_block> and <http://www.mathworks.com/help/sim...

10 years ago | 0

| accepted

Answered
add each element of one vector to each element of another vector
v=1:6; ii=repmat(v',6,1), jj= reshape(repmat(v,6,1),[],1); out=[ii,jj]

10 years ago | 1

| accepted

Answered
Replacing the contents of a matrix
v=[0 1 2 3 4 5]' out=v*0.5

10 years ago | 0

Answered
How to create a matrix with variables?
v={0 1;'act*fr' 'y'}

10 years ago | 0

Answered
Classify numbers in a vector
A = [8 1 2 3 4 5 9 10 13 15 17 18 19 21 22 24 25]; ii=[1 diff(A)]; idx1=[1 find(ii~=1)]; idx2=[idx1(2:end)-1 numel(A)]; ...

10 years ago | 1

Answered
How to split a matrix by a column by whether values are greater or less than a number
A=randi(10,6,3) idx=A(:,3)>7 A1=A(idx,:) A2=A(~idx,:)

10 years ago | 0

Answered
Separate Date and Time from excel file column
v={'DD22122015000101';'DD22122015000201';'DD22122015000301'} d=cellfun(@(x) [x(3:4) '/' x(5:6) '/' x(7:10)],v,'un',0) t=cell...

10 years ago | 0

| accepted

Answered
multiple columns to one column
A=[1 2 3;4 5 6;7 8 9]; B=A(:) % Or Use reshape function B=reshape(A,[],1)

10 years ago | 0

| accepted

Answered
Is there any way to multiply strings like they're variables?
You can use symbolic variables <http://www.mathworks.com/help/symbolic/create-symbolic-numbers-variables-and-expressions.html>

10 years ago | 0

Answered
How do I create a 2-D array with variable size columns?
You can use cell arrays v={1:10 1:5 1:3}

10 years ago | 0

| accepted

Answered
Using part of data as variables
v=[ 0 1 0 12 1 1 0 13 4 1 0 10 5 1 0 14 6 1 .1 17 2 1 .1 11 7 1 .1 12 8 ...

10 years ago | 0

| accepted

Answered
How to save values of loops ?
be=zeros(16,1); for s=1:2:16 bety1=((z3(0+s:1+s,1:20)*z3(0+s:1+s,1:20)')^-1)*(z3(0+s:1+s,1:20)*y3(1:20)); be(s:s+1)=b...

10 years ago | 0

| accepted

Load more