Answered
How can i count the number of iterations?
k=0 while exprssion k=k+1 %your code end

10 years ago | 0

Answered
How can I mix up "blocks" of elements of 2 vectors and put them in a new vector?
A=randi(10,1,30) % -----Example------- n=numel(A) id=randi(4,1,n); ii=cumsum(id); jj=find(ii<=n); ss=jj(end); e=n-ii(ss...

10 years ago | 0

| accepted

Answered
Make a function tha makes zero certain elements of the matrix corners as shown below
n=5 A=randi(5,n) % ---Example----- [n,m]=size(A) nn=fix(n/2) id=[1:nn n-nn+1:n] A(id,[1 n])=0 A([1 n],id)=0

10 years ago | 1

Answered
find index of cells containing other cells
A=arrayfun(@(x) randi(5,1,randi(10)),1:9,'un',0) % Example m=3 % Looking for 3 in each cell indices=cellfun(@(x) find(i...

10 years ago | 0

Answered
Delete a cell, not some elements
a={1 2 3 4} a(1)=[]

10 years ago | 0

| accepted

Answered
How to create this specified matrix?
u=1:10 n=numel(u) v=repmat(u',1,n) w=cell2mat(arrayfun(@(x) circshift(v(:,x),[x-1 0]),1:n,'un',0) ) out=tril(w)

10 years ago | 0

Answered
Using regexp to create dataset
a='5,573346285,746540138, NA ,1341119065,NA,7,0,2,1341111281,"-1,-1,-1,0,-1",-0.8' b=regexp(a,'\<".+\>"\,','match'); c=strre...

10 years ago | 0

Answered
Assigning matrix to cells
cellfun(@(x) zeros(1,3),cell(3,2),'un',0) Or mat2cell(zeros(3,2*3),ones(1,3),3*ones(1,2))

10 years ago | 0

| accepted

Answered
Finding NaNs in cell array.
Data_text={'Speed' 'Load' nan 'Sample'} Data_text(:,cellfun(@(x) any(isnan(x)),Data_text(1,:)))=[]

10 years ago | 0

Answered
how can delete a part of image name?
str={'AHTD3A0001_Para1.tif' 'AHTD3A0002_Para1.tif' 'AHTD3A0003_Para1.tif'} out=strrep(str,'AHTD3A','')

10 years ago | 0

| accepted

Answered
Function Counter of digits
name='w1o4rd12' out=numel(regexp(name,'\d+')) %or name='w1o4rd12' a=name-'0' idx=a>=0 & a<=9 out=nnz(idx)

10 years ago | 0

Answered
converting numbers to characters in a matrix
A=[1 2;3 4] B=arrayfun(@num2str,A,'un',0)

10 years ago | 0

Answered
how to store n matrix in an other matrix of size n
If your matrices have the same size (nxm), you can use nxmxp matrix. For example A1=[1 2;3 4;5 6]; A2=[7 8;9 10;1 1]; Y...

10 years ago | 0

Answered
pick one value per munite
A={'18-May-2016 14:04:17' '18-May-2016 14:05:07' '18-May-2016 14:05:54' '18-May-2016 14:06:43' '18-May-2016 14:07:34' '18...

10 years ago | 0

Answered
Finding the maximum amplitude in a spectrogram for a range of frequencies
[max_value,freq]=max(your_signal)

10 years ago | 0

Answered
Is it possible to create a binary vector then write it to a file?
you can work with logical data type a=logical([1 0 0 1])

10 years ago | 1

Answered
How to get yearly sum values
d={'01/04/1960';'23/09/1960';'08/01/1980';'18/11/1980'} v=[5; 4.2; 6;7] a=datevec(d,'dd/mm/yyyy') [y,~,kk]=unique(a(:,1)) ...

10 years ago | 1

| accepted

Answered
converting specific characters to a variable
<http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F>

10 years ago | 0

Answered
How to join two numeric arrays into a single string?
A=rand(10,1); B=rand(10,1); out=sprintf('%f:%f ',A,B)

10 years ago | 1

| accepted

Answered
Transpose Translation Vector for addresses
Y=sortrows(X)

10 years ago | 0

| accepted

Answered
How can I read multiple image files in a folder using Simulink?
Use Matlab function block

10 years ago | 0

Answered
adding rows to array with order
data=[1.0452;1.0645;1.1027;1] fixed_data=[1;1.0452] other_data=[1.064562;1.102656] %--------------------------------- merg...

10 years ago | 0

Answered
How to: taking out 2d matrix from 3d matrix
z=randi(4,4,3,2) A=permute(z,[2 3 1]) z1=A(:,:,1) z2=A(:,:,2)

10 years ago | 1

Answered
how to find and replace corresponding matri
idx=celfun(@isempty,a1) a1(idx)=[] out=cell2mat(a1)

10 years ago | 0

Answered
Creation of matrix?
A=1:24; B=A*10; C=zeros(24,144); p=0; for k=1:6:144 p=p+1; C(p:end,k)=A(p); C(p:end,k+1)=B(p); end C ...

10 years ago | 0

| accepted

Answered
how to insert the column [60;80] into the third column
A=[1 5 6; 3 0 8] A=[A [60;80]] %Or A(:,end)=[60;80]

10 years ago | 0

| accepted

Answered
How to import a 3D image in matlab
You can use a <http://www.mathworks.com/products/3d-animation/ Simulink 3D Animation toolbox>

10 years ago | 0

Answered
How to accumulate values in a vector?
str1='abc' str2='def' A=[str1' str2'] %Or str1='abc' str2='def' A{1,1}=str1 A{1,2}=str2 str1='123' str2=...

10 years ago | 1

| accepted

Load more