Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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)...

mehr als 10 Jahre vor | 0

Beantwortet
why this command is not work
Use plot not Plot

mehr als 10 Jahre vor | 0

Beantwortet
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)

mehr als 10 Jahre vor | 2

Beantwortet
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)

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
Reading time and dates from Excel
Use datenum function

mehr als 10 Jahre vor | 0

| akzeptiert

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

Beantwortet
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')

mehr als 10 Jahre vor | 0

| akzeptiert

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

mehr als 10 Jahre vor | 0

Beantwortet
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)

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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]

mehr als 10 Jahre vor | 1

| akzeptiert

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

Beantwortet
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)]; ...

mehr als 10 Jahre vor | 1

Beantwortet
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,:)

mehr als 10 Jahre vor | 0

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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)

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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>

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 10 Jahre vor | 0

| akzeptiert

Mehr laden