Answered
what can i do for this problem?
val=rand(8,8,4096); % Example m=size(val,3); a=arrayfun(@(x) circshift(val(:,:,x),-1),1:m,'un',0); out=reshape(cell2mat(a)...

13 years ago | 0

| accepted

Answered
how to shift a pulse by predefined time in simulink environment?
Instead of setting the sample time to ts, you can add an offset to like this Sample time = [ts to]

13 years ago | 0

Answered
how to random -1 and 1?
m=randi(2,8)-1 m(~m)=-1 %or m=randi([-1 ,1],8) m(~m)=-1 %or m=fix(rand(8)+0.5) m(~m)=-1

13 years ago | 0

| accepted

Answered
Generating a particular sequnce of numbers
d=4 cell2mat(arrayfun(@(x) x:-1:1,1:d,'un',0))

13 years ago | 2

| accepted

Answered
How can I create a random binary matrix with a specified number of 1's and 0's?
a=zeros(5); n=3 % number of 1 a(randi(numel(a),3,1))=1

13 years ago | 0

Answered
How can i fplot two functions in different intervals?
x1=0:0.1:10; x2=10:0.1:20; y1=sin(x1); y2=cos(x2); plotyy(x1,y1,x2,y2) % or x1=0:0.1:10; x2=10:0.1:20; y1=sin(x1...

13 years ago | 0

| accepted

Answered
How to change the color of a single point in a scatter plot?
x = [ 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5]; y = [ 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5]; plot(x,y...

13 years ago | 5

| accepted

Answered
How to create an cell array
a=[1 2 3 4] Your_cell_aray=num2cell(a)

13 years ago | 0

| accepted

Answered
how to print column values into column 1
If the size of newfile2 is correct, there is no error in your code A=num2cell(rand(5,20,1)) newfile2=num2cell(randi(5,20,1...

13 years ago | 0

Answered
how to plot the data in a cell array
s={'one','two','one','three','one','four','one','two'} [a,b,c]=unique(s,'stable') n_occ=accumarray(c,1) out=[a' num2cell(n_...

13 years ago | 0

Answered
Delete row from dataset array
test(1,:)=[]

13 years ago | 0

| accepted

Answered
pole placement in M-file
p=eig(A-b*k)

13 years ago | 0

| accepted

Answered
Add row/column names to a matrix
You've missed a bracket M = rand(5) dataset({M 'FOO','BAR','BAZ','BUZZ','FUZZ'}, ... 'obsnames', {'ROW1',...

13 years ago | 4

| accepted

Answered
Is there a way to tell uigetfile to start browsing in a folder other than the current one?
*Edit* uigetfile('*.m','select the m file','E:/matlab')

13 years ago | 4

| accepted

Answered
hii.... extract number from string
s='100*exp(4*x)+156*exp(77*x)' out=regexp(s,'\d+','match') % or if you want to include non integer number s='100.2*ex...

13 years ago | 1

Answered
comment je peux créer une matrice triangulaire inférieure remplit par 1 de très grande dimension?
Il semble que la taille de votre matrice est très grande, et ne peut être supportée par Matlab. Consultez le lien suivant pour p...

13 years ago | 0

| accepted

Answered
How to find specifying pattern in the string
s={'Vbx_fg_ih_kj','Vbxfg_ih_kj', 'Vxx_gf_ij_kl', 'Vamhji_ many','Vbxx_'} idx=s(cellfun(@(x) ~isempty(regexp(x,'V(b|x)x_')),s)...

13 years ago | 1

Answered
Remove overlapping index ranges within a single array
a= [1,2;3,5;4,12;5,15;6,23;10,12;13,14;19,22;24,27;26,28]; b=arrayfun(@(x) a(x,1):a(x,2),1:size(a,1),'un',0); k=1; while k<...

13 years ago | 0

Answered
Remove overlapping index ranges within a single array
*Edit* a = [1,2; 3,5; 3,6; 4,5; 8,10] b=arrayfun(@(x) a(x,1):a(x,2),1:size(a,1),'un',0); k=1; while k<numel(b) c...

13 years ago | 0

Answered
Find the filename with the biggest number?
s={'20130721_SPLBRENT3_140554.mat' '20130721_SPLBRENT3_160554.mat' '20130721_SPLBRENT3_180554.mat' '20130722_SPLBRENT3_0756...

13 years ago | 2

Answered
how to print out rest of data
Create a new array from your original array. For example if A=rand(891,1) % your original array new_A=A(362:891)

13 years ago | 0

Answered
Separate path string into drive and folders
s='C:\user\files\myFile.txt' out=regexp(s,'\','split')

13 years ago | 8

| accepted

Answered
Exclude a keyword from a file search?
file={'20130723_SPLBRENT3_180744.mat' '20130723_SPLBRENT3_190749.mat' '20130723_SPLBRENT3_200749.mat' '20...

13 years ago | 0

| accepted

Answered
Define the deafult path for uisave
f='E:\matlab' % For example your default folder uisave('A',f)

13 years ago | 0

Answered
Simulation Time Unit in Simulink
Why is this important? at the end of simulation, you can convert second to minute or whatever you want. And also, if you are not...

13 years ago | 0

Answered
how to compile and print data.
a =[ 1,2,3,4,5,6,7,8,9,10] b = [11,12,13,14,15,16,17,18,19,20] [a' b']

13 years ago | 0

Answered
Extracting text from a cell
A={'00003H102','00003H103','00003H104','00003' []} B=cellfun(@(x) x(1:min(numel(x),6)),A,'un',0)

13 years ago | 0

Answered
searching in an mfile
In your matlab editor there is an icone called *find files*, use it to find all the m files that contains u_vec(9) Look at <h...

13 years ago | 0

Answered
Extracting text from a cell
A='00003H102' A(1:6) If you have a cell array A={'00003H102','00003H103','00003H104'} B=cellfun(@(x) x(1:6),A,'un'...

13 years ago | 0

Answered
join numbers in vector
a=[13 30 44 12 44 23 12] b=strrep(num2str(a),' ','') % This is a string, if you to get a number b=str2num(strrep(nu...

13 years ago | 1

Load more