Answered
Array Question time again
A={1:4 5:8 9:12;20:23 24:27 28:31} B=num2cell(cell2mat(A),2)

12 years ago | 0

| accepted

Answered
Special case of join
a= [1 2 3] b= [4 5] [x,y]=meshgrid(a,b) out=[x(:) y(:)]

12 years ago | 0

| accepted

Answered
How to Resize data in column vector?
A=[0;0;0;0;0;232;222;245;342;232; 0;0;0;0;0;0;0345;323;324;345;343;0;0;0] idx=[1 diff(A') ]==0 & A'==0 A(idx)=[]

12 years ago | 0

Answered
How to Resize data in column vector?
A=[0;0;0;0;0;232;222;245;342;232; 0;0;0;0;0;0;0345;323;324;345;343;0;0;0] idx=[0 A'==0 0] ii=strfind(idx,[0 1]) jj=strfind(...

12 years ago | 0

Answered
reshape 3d matrix to obtain a column vector
A(:,:,1) = [1 2 3; 4 5 6; 7 8 9] A(:,:,2) = [10 11 12; 13 14 15; 16 17 18] A(:,:,3) = [19 20 21; 22 23 24; 25 26 27] B=perm...

12 years ago | 1

| accepted

Answered
categorical histograms: combining missing category values
a1={'a' 'b' 'm' 'z'}; b1=[10 4 12 23]; a2={'a' 'aa' 'b' 'e'}; b2=[2 1 5 7]; c=unique([a1 a2]); data1=zeros(1,numel(c));...

12 years ago | 0

| accepted

Answered
Set Axis With Interval
set(gca,'xtick', your_interval)

12 years ago | 4

Answered
how to write this data in text file?
dlmwrite('your_file.txt',M) % M is your matrix

12 years ago | 0

Answered
How to save function outputs as a vector to workspace.
for k=1:N [A(k) B(k)] = coconuts( a, b, c); end

12 years ago | 1

Answered
Multiplot figure in Simulink
You can do it with <http://www.mathworks.com/products/rtwt/ Real Time Windows Target> toolbox

12 years ago | 0

Answered
merge datset one to many
A={'firm1_1970', 'firm1_1971','firm1_1990', 'firm2_1970', 'firm2_1971','firm2_1985','firm100_1995'} B=regexp(A,'(?<=_)\d+','m...

12 years ago | 0

| accepted

Answered
Error Inner Matrix Dimensions must agree?? Help!
A=1:5 B=diff(A) Notice that A and B haven't the same size

12 years ago | 0

Answered
How to plot function
x is an input argument, you can't assign values to x inside the function. save this function as staircase.m function y =...

12 years ago | 0

Answered
Remove NaNs during plotting (keep array the same length)
for k=1:length(temps) sss=ss(k); if ~isnan(sss) ht = text(tempx{k}, tempy{k}, num2str(sss),'Parent',ha); ...

12 years ago | 0

| accepted

Answered
For loop or while loop? help please
m=7 for k=1:3 if k>1 m=6 end for i=1:m do something end end %or for k=1:3 for i=1:7-(k...

12 years ago | 0

| accepted

Answered
Delete the rows with its first character other than a number and copy all the other rows into a new file.
fid = fopen('file.txt'); a=textscan(fid,'%s') fclose(fid); b=a{:}; c=b(cellfun(@(x) ~isempty(regexp(x,'^\d','match')),b)) ...

12 years ago | 0

| accepted

Answered
Variable / which matlab does not forget ?
Nothing is forgotten, you can the value of x at any time x = get(handles.edit1,'String')

12 years ago | 0

Answered
Summing parts of an array??
sum(D(1:8))

12 years ago | 4

| accepted

Answered
to which demux outport is a block connected
Look at this answer <http://www.mathworks.com/matlabcentral/answers/109816-how-i-can-find-the-connection-between-two-blocks-of-s...

12 years ago | 0

| accepted

Answered
How to find missing number in repeating sequence.
v=[1 2 3 4 1 2 3 1 2 3 4]; sequence=[1 2 3 4]; ii=find([1 diff(v)<=0]); jj=[ii(2:end)-1 numel(v)]; for k=1:numel(ii) ...

12 years ago | 1

| accepted

Answered
How would I concatenate more than 2 mat files having same datas
Load your data in a loop, then concatenate them

12 years ago | 0

| accepted

Answered
Compute average of a column in a cell without considering NaN values
A={56276 2009 '-' 56278 2009 NaN 56281 2009 NaN 56285 2009 33.9 56313 2009 42.5} c3=cell2mat(A(2:end,3)) out=nanme...

12 years ago | 1

| accepted

Answered
display into array with bracket
Time = [68535763846, 6538764367, 536743643] out=['[' num2str(Time) ']'] %or Time = [68535763846, 6538764367, 53674...

12 years ago | 0

Answered
How to convert a cell array of strings to numerical values I can plot?
T=str2double(Temperature); M=str2double(moment); plot(T,M)

12 years ago | 3

| accepted

Answered
Reading from a .txt file
d=importdata('file.txt'); A=d; b=A(4:4:end,1); A(4:4:end,:)=[]; A=reshape(A,3,4,[]); disp(b) disp(A)

12 years ago | 1

| accepted

Answered
merge cells into a single one
If your data looks like v={1:3 10:20 4 100:105} out=cell2mat(v)

12 years ago | 0

Answered
Variable not recognized outside a loop
Why do you think F is not recognized? Type F you will see the result You have maybe forgotten the incrementation of v...

12 years ago | 0

| accepted

Answered
get axis value of a subplot
% -----Example---------------------- x=repmat((1:10)',1,9); y=rand(10,9); for k=1:9 subplot(3,3,k); plot(x(:,k),y...

12 years ago | 0

| accepted

Answered
How to remove LQR error ?
Your model does not have 5 states (juste 2 states),one of them is not controllable. then you can't calculate the gain k by lqr m...

12 years ago | 0

Answered
Convert analog to digital
Use stem function instead of plot

12 years ago | 0

| accepted

Load more