Answered
Size of figure inner box
Example close all y1=sin(1:100), y2=cos(1:100) plot(y1) ax1=gca figure plot(y2) ax2=gca pos=get(ax1,'position') se...

13 years ago | 1

| accepted

Answered
Construct Power of Matrix without for loop
Example A=magic(2); N=3; B=cell2mat(arrayfun(@(x) A^x,1:N,'un',0))

13 years ago | 0

| accepted

Answered
generate unique random matrix using key
key=3 % for example rng(key) out=uint8(randi([0 255],2,4) % matrix 2x4

13 years ago | 0

| accepted

Answered
Getting average of sections of a single row of data
m1=mean(Seg1.P_wave(1:20)); m2=mean(Seg1.P_wave(103:130)); m3=mean(Seg1.P_wave(229:259)); m4=mean(Seg1.P_wave(351:386))...

13 years ago | 1

Answered
Combine two cell arrays
Maybe you want X=[num2cell([18;21;17;20;19]) cellstr(['m';'f';'m';'m';'f'])]

13 years ago | 0

| accepted

Answered
The best way to save huge amount of data.
Try PathName=uigetdir('*.txt'); cd(PathName); names=dir('*.txt'); n=length(names); spectrum=cell(n,1)...

13 years ago | 0

Answered
How to load MAt file into 3D matrix
A = zeros(240,320,516) nummer=0 for i= 1:516 nummer = nummer +1 ext = '.MAT' naam = 'PVCWARM0007' file...

13 years ago | 0

Answered
indexing cell array of arrays
for k=1:numel(A) A{k}=A{k}(1:4); end

13 years ago | 3

Answered
indexing cell array of arrays
If A is your cell array cellfun(@(x) x(1:k),A,'un',0)

13 years ago | 1

Answered
count groups of elements and distances between them
A= [6 6 6 4 4 4 4 4 6 5 5 7 7 7 8 9 8 7 0 0 0 0]; A=num2str(A); A(A==' ')=''; [a0,a1,group0]=regexp(A,'[06]+','start','end'...

13 years ago | 1

Answered
How can you convert a scientific number to decimal?
a=4.1084e+001-9.6671e+002i out=sprintf('%.2f+%.2fi',real(a),imag(a)); out=strrep(out,'+-','-')

13 years ago | 0

| accepted

Answered
Plot the line and give maximum value of y and x at which y is maximum?
*Edit* Example close x=0:0.1:10; y1=sin(x)./(x+1); y2=sin(x-1)./(x+1); plot(x,y1); hold on plot(x,y2,'r') a=get(g...

13 years ago | 0

Answered
Select a rectangle in a image.
Maybe you are looking for imrect function

13 years ago | 0

Answered
how can I create variable number of matrices (arrays) based on an arbitrary input.
Suppose we have a matrix a=[1 2 ; 3 4; 5 6]; %the size of a is [n,m]=size(a) %Now, what do you want to create? ...

13 years ago | 0

Answered
Undefined function 'Datatime' for input arguments of type 'double'.
What is Datatime? is it a function you wrote?

13 years ago | 0

Answered
where is wrong with texlable
Just use xlabel(texlabel('mu1'))

13 years ago | 0

| accepted

Answered
Count all unique elements in a 3d matrix
a1=randworld(:,:,1) a2=randworld(:,:,2) a3=randworld(:,:,3) v=cell2mat(arrayfun(@(x1,x2,x3) [x1 x2 x3],a1(:),a2(:),a3(:),'u...

13 years ago | 1

| accepted

Answered
Saving variable of selected value from simulink matlab fcn to workspace
assignin('base','variable_name',your_fcn_variable)

13 years ago | 0

Answered
I want to create multiple scatter plots.
Use subplot function

13 years ago | 0

Answered
turn data to time series
dat='1992-12-12 12:12:12', a=datenum(dat,'yyyy-mm-dd HH:MM:SS') % to get dat, datestr(a)

13 years ago | 0

Answered
Read data from string
y=regexp(x,'(?<=\()[\w]+(?=\))','match')

13 years ago | 1

Answered
'load' command - loading and using data from a .MAT file
x=load('current1.mat'); MAT=x.current1 If you want to know the variables names in your file whos('-file','current1.m...

13 years ago | 0

| accepted

Answered
Need help with Difference Equation
You can use a for loop, because Matlab does not allow indices <=0 you should begin your for loop with |k=3|. then your initial c...

13 years ago | 1

Answered
how to set the index to run this program?
d1=zeros(1,numel(0:Ns/2)); d2=d1; d3=d1; m=1 for k=0:Ns/2 d1(m)=data(2*k-2); d1(m+1)=conj(data(2*k-1...

13 years ago | 0

Answered
Cell arrays in MATLAB
That means you an empty cell

13 years ago | 0

Answered
How to find unique lines in cell arrays
use unique function

13 years ago | 0

| accepted

Answered
What is the code to do a transfer function between input and output?
You can use this code syms p N=[1 2] D=[1 3 4] moel=sum(N.*p.^(numel(N)-1:-1:0))/sum(D.*p.^(numel(D)-1:-1:0))

13 years ago | 0

Answered
What is the code to do a transfer function between input and output?
N=[1 2] D=[1 3 4] model=tf(N,D) % for continuous system ts=0.1; modeld=tf(N,D,ts)% for discrete system

13 years ago | 0

Answered
How to make a matrix from several column vectors
m=size(norm,1); a=zeros(m,30); for k=1:30 a(:,k)=norm(:,1,k); end %or a=reshape(norm(:,1,1:30),[],30)

13 years ago | 1

Load more