Answered
Combine the subplot into a one plot
Use *hold on* command

10 years ago | 0

| accepted

Answered
How do I remove leading digits in a .CSV
s='001 00:05:04:058299394' a=regexp(s,'(?<=\s+)\S+','match')

10 years ago | 0

Answered
Writing multiple structures to user specified excel file
load Example v=[struct2cell(Data1.data)] out=v(:,:)' xlswrite('file.xlsx',out)

10 years ago | 0

| accepted

Answered
How to create a scope viewer from a matlab command ?
add_block('simulink/Sinks/Scope',['model_name/scope_name'])

10 years ago | 0

Answered
i have an image with a size of 300x300. how can i divide the image into 10x10 and then save it and take the average of 100 pixels ? thanks a lot guys
A=randi(255,300,300); imshow(A) out=blockproc(A,[10 10],@(x) mean(x.data(:)))

10 years ago | 0

Answered
how to add ones to binary matrix with condition to add them ?
B = [ 1 3 0 1 1 0 1 1 1 1 2 0 ] C = [ 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 ] n=find...

10 years ago | 0

| accepted

Answered
Is it possible to delete a line from a text file where a specific string exists?
M={'10-D-0343' '14.01.10' '04-Apr-2016' '11-W-282' '14.21.50' '04-Apr-2016' '01-D-5693' '14.58.40' '04-Apr-2016'} M(any(ism...

10 years ago | 1

| accepted

Answered
Concatenate variable value and variable name into new variable name.
animal = 'cat' out=sprintf('%s_mean',animal)

10 years ago | 0

Answered
Using an If statement in a For loop to sum quantities from an excel file.
A=[2010 1;2010 3;2011 5;2010 8 ;2013 4 ;2014 9;2016 1;2014 2 ;2014 7;2016 7] [ii,jj,kk]=unique(A(:,1)) out=[ii accumarray(kk...

10 years ago | 0

Answered
To find a particular row from a matrix and delete that from matrix
Line_Data(Line_Data(:,2)==2 & Line_Data(:,3)==3,:)=[] %Or Line_Data(ismember(Line_Data(:,2:3),[2 3],'rows'),:)=[]

10 years ago | 1

Answered
Index out of bounds
delta_x=300; delta_y=250; delta_z=30; delta_t=10; alpha=2.84*10^6; phi=0.2; A=delta_y*5100; t=0:10:100; i=length(t); x=li...

10 years ago | 0

Answered
How to reduce the number of data points in a time series data.
Use downsample function: <http://www.mathworks.com/help/signal/ref/downsample.html>

10 years ago | 7

| accepted

Answered
how to merge three matrix into one ?
If you want to append with zeros A = [ 1 1 0 0 1 0 1 0 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 0 ] B = [ 2...

10 years ago | 0

| accepted

Answered
How to sum up unique arrays in the matrix
*Edit* A = [10 1 180 10 1 40 10 1 40 10 1 160 10 2 10 10 3 410 10 1 10 10 1 50 12 1...

10 years ago | 0

| accepted

Answered
convert a matrix with some zero to non zero txt file
a=[ 1 2 3 ; 1 0 0 ; 0 0 0; 4 5 6] I for k=1:size(a,1) b=a(k,:) b=b(b~=0); dlmwrite('file1.txt',b,'-append') ...

10 years ago | 0

| accepted

Answered
How to convert cell array into double in table
Probably one of the columns is not a cell array. Check if all columns are cell array

10 years ago | 0

Answered
How to diagonally fold a square matrix?
A=[1 -3 2 4;5 7 8 9;6 8 2 1;3 3 3 3 ] n=size(A,1) idx=cell2mat(arrayfun(@(x) sub2ind([n n],x*ones(1,n-x),x+1:n),1:n-1,'un',0...

10 years ago | 0

Answered
find if there are more then 10 consecutive NaN values
A = [ 0 0 1 1 1 1 1 1 1 1 1 1 1 0] ii=strfind([0 A 0],[0 1]) jj=strfind([0 A 0],[1 0]) idx=max(jj-ii)

10 years ago | 0

| accepted

Answered
Finding nearest low match in array
f= [1:0.5:5] val = 2.3 [ii,jj]=sort(f) ii1=find(ii>val,1)-1 idx=jj(ii1)

10 years ago | 0

Answered
How can I use a time dependent function as input source for my Simulink Model?
You can use the clock block to get the time. <http://www.mathworks.com/help/simulink/slref/clock.html>

10 years ago | 1

| accepted

Answered
splitting numbers in a cell
If A is your matrix x=A(:,1) y=A(:,2) z=a(:,3)

10 years ago | 0

Answered
how to find subsequences
a={'1' '631' '618' '574' '678'} n=numel(a) for k=1:n b{k}=arrayfun(@(x) k:x,k:n,'un',0) end c=[b{:}]' out=cellfun(@(x...

10 years ago | 0

| accepted

Answered
Cant Remove Axis Labels
t=1:10 y=t.^2 plot(t,y) set(gca,'xtick',[])

10 years ago | 4

Answered
Creating 2d scatter plot with different dot size and color accoridng to vlaues in matrices
M1=[1 3 4 5 8 2 7 3 9 1 2 4 5 4 3 7 1 9 8 6] M2=[-0.1 -0.93 0.4 ...

10 years ago | 0

| accepted

Answered
when i run matlab code this sentence appear?
This message occurs when you use variables that are not defined. For example: y=5*t How Matlab will calculate 5*t if the...

10 years ago | 0

Answered
hello everyone i want to ask that is there any option to concatenate strings or numbers in matlab
Yes you can concatenate numbers and strings, but if you have a specific problem post it. % Example number=234 out=sprintf...

10 years ago | 0

Answered
Average row elements for three columns?
a=rand(10,3) v=mean(a,2)

10 years ago | 0

Answered
convert a matrix with some zero to non zero matrix
M = [ 1 2 3 ; 1 0 0 ; 0 0 0; -1 -1 2]; out=arrayfun(@(x) strrep(x,0,nan),M(any(~~M,2),:))

10 years ago | 0

Answered
How to stop/delay execution for specified time in matlab function block in simulink
You can use switch block <http://www.mathworks.com/help/simulink/slref/switch.html>

10 years ago | 0

Load more