Answered
How to cut last empty space characters from a string?
str='word ' out=strtrim(str)

10 years ago | 0

Answered
MATLAB cannot call or index into a temporary array in for loop
I don't know what you want, your example is not appropriate, comparing letters with 0! A=[1 2 0 5 0 7] B=A(A~=0)

10 years ago | 0

Answered
How to ignore values or set to NaN while keeping matrix same size?
A(A>100)=nan

10 years ago | 1

| accepted

Answered
How to stop calculation if conditon meets?
for x=0:100 % your code end

10 years ago | 0

| accepted

Answered
Divide a cellarray in n parts
A=num2cell(1:20); out=reshape(A,4,5)

10 years ago | 0

| accepted

Answered
Retrieving minimum values for parts of a matrix
A=[ 1958 2; 1958 3; 1959 4; 1959 5; 1959 6 ] [ii,jj,kk]=unique(A(:,1)) out=[ii accumarray(kk,(1:numel(kk))',[],@(x) min(A(x...

10 years ago | 0

| accepted

Answered
Find the maximum value of a set of arrays in a for loop
unique(Tresult)

10 years ago | 0

| accepted

Answered
How to add more names on a plot axis
Look at this example x=1:20 y=randi(10,1,numel(x)) bar(x,y) n=numel(y) names=strsplit(sprintf('name%d ',1:n)) ax ...

10 years ago | 0

| accepted

Answered
Add a number of zeros to matrix row depending on its content.
B=eye(numel(A)) %Or maybe you want A = [ 1; 2; 3] n=numel(A); m=max(A) B=zeros(n,m) ii=sub2ind([n,m],1:n,A') B(...

10 years ago | 0

| accepted

Answered
How to eliminate certain data from a set of 300 x 4 data?
A=[x' y' scores' Nop']; id=x==0.05 & y==0.5 out=A(id,:)

10 years ago | 0

| accepted

Answered
x and y axes boundaries
% -----For x axis------------------------- xt=get(gca,'xtick') xtl=arrayfun(@(x) num2str(x),abs(linspace(-192,192,numel(xt)...

10 years ago | 0

Answered
Sort 3D matrix depending on specific column
%-----------Example---------- A=randi(30,10,10,4) %-------------------------------- out=cell(1,k); for k=1:size(A,3) ...

10 years ago | 0

Answered
how can i see the compete result
celldisp(ans.rank)

10 years ago | 0

| accepted

Answered
Matrix Zero padding for filter (image processing)
matrix = ones(5) n=size(matrix,1) result_matrix=zeros(2*n-1) result_matrix(1:2:end,1:2:end)=matrix

10 years ago | 0

Answered
i have a question
out=min(reshape(K,28,[]))

10 years ago | 0

Answered
How to create matrix from another matrix?
You want the first 41 rows of your matrix A(1:41,:)

10 years ago | 0

| accepted

Answered
Importing only a fraction of a database using dataset
nc=6; % Number of column in your csv file nr=500 data=csvread('file.csv',0,0,[0 0 nr-1 nc-1])

10 years ago | 0

| accepted

Answered
I have an m file routine. How can I store the file along with its calling m file tree?
Save your file like you are used to do it.

10 years ago | 0

Answered
How can I represent this function on simulink ?
B=2; landa=0:2:20; Cp=0.5*(116./landa+0.4*B).*exp(-21./landa); plot(landa,Cp)

10 years ago | 0

| accepted

Answered
Attempted to access t(1,4); index out of bounds because size(t)=[10,3] , how to solve this problem
Since you have size(t)=[10,3] Then check why you are writing t(1,4) There is another problem with your for loop ...

10 years ago | 0

| accepted

Answered
how to store a series of single rows that have different numbers of columns
You can use cell arrays for k=1:5 idx=randi; out{k}=rand(1,idx); end celldisp(out)

10 years ago | 0

Answered
How to find different frequency for each non-zero amplitude separated by zero amplitude inside a signal?
If y is your signal ii=logical(y) idx=strfind(ii,[0 1])

10 years ago | 0

Answered
Reverse Input Image coordinates
Im=imread('Your_image') imshow(Im) Matlab reads your image and displays it as it is displayed by any images editor. Matlab...

10 years ago | 0

Answered
generate a ramp signal based on an external input
You can use a clock block, and multiply it by your K value, using a product block, then multiply the output of the product block...

10 years ago | 0

| accepted

Answered
How to plot figure with following?
% Example x=0:0.1:10; y=100*sin(x); %---------------- idx=y>=25 scatter(x(idx),y(idx),'or'); hold on scatter(x(~idx),y(...

10 years ago | 0

Answered
'rows' function meaning in matlab
'rows' This will display the word 'rows'. If you type 'any word' This will display any word

10 years ago | 0

| accepted

Answered
how to hiding the legend?
hl=findobj(gcf,'type','legend') delete(hl)

10 years ago | 0

| accepted

Load more