Answered
Indexing (l,m.n) matrix for n=1,2,3,....?
x=zeros(2) the size of x is 2x2, but you can also consider it as 2x2x1x1x1x...x1. Now if you want to use x(:,:,1) there is ...

9 years ago | 0

Answered
number of non-nan values across each element in n-dimensional matrix
b=sum(isnan(A),1) b=sum(b,2)

9 years ago | 0

Answered
how to find the index of the row
v=[8;6;1;2;3;7;5;4] m=3.5 mv=[m ;v] [ii,jj]=sort(mv) idx=find(jj==1) % m is between a1 and a2, idx1=jj(idx-1) idx2=jj(...

9 years ago | 0

Answered
Genarating 3d Plot from a struct exported matfile
If file.mat is your mat-file data=load('file.mat') n=fieldnames(data) x=data.(n{1}) y=data.(n{2}) z=data.(n{3}) plot3(...

9 years ago | 0

| accepted

Answered
Multiply a set of matrices (3D array) by a vector of values
% -------Example----------------- M=randi(3,3,2,4) v=1:4 %-------------------------------- bsxfun(@times,M,reshape(v,...

9 years ago | 3

| accepted

Answered
Forming a matrix based on the magnitude of a vector values
rho=randi(10,10,1) % Example [x,y]=ndgrid(rho,rho) out=x>=y

9 years ago | 0

Answered
Can I change quantization interval in time?
It's not called quantization in time, it's sampling time. Just set the sample time you want

9 years ago | 0

Answered
Convert 2D image to 3D with color map
Y = ind2rgb(X,map)

9 years ago | 1

Answered
Create a Scatter plot from a cell array
load CS06 x=cell2mat(CS06(:,2)) y=cell2mat(CS06(:,3)) scatter(x,y)

9 years ago | 2

| accepted

Answered
Does findpeaks have a threshold option?
Look at the help, you will find what you need <http://www.mathworks.com/help/signal/ref/findpeaks.html>

9 years ago | 0

Answered
how to change languare
<http://www.mathworks.com/matlabcentral/answers/126078#answer_133624>

9 years ago | 0

Answered
Extract numbers from a cell array of strings
s ={'HI_B2_ TTT4009_D452_07052016.xlsx' 'HI_H2G_ TTT4002_D259_070516.xlsx' 'HI_B2C_ 4008_D1482_070516.xlsx' 'HI_B2C_ 008_D1...

9 years ago | 1

| accepted

Answered
problem in my program
Check the class of n class(n) You will find the uint8 class, now try n=double(95) n*8

9 years ago | 0

| accepted

Answered
convert .csv file to .xlsx?
Look at this example [~,~,a]=xlsread('your_file.csv') b=regexp(a,',','split') c=reshape([b{:}],numel(b{1}),[])' xlswrite...

9 years ago | 2

Answered
Naming VariableNames in a table based on a cell array
data2=[1,5,3,5,6;1,2,4,12,6] data2_txt={'Var1','Var2','Var3','Var4','Var5'} Table1=cell2table(num2cell(data2),'VariableNames...

9 years ago | 0

| accepted

Answered
Sort Excel files by file content?
*Edited* a=regexp(s,'.+TTT.+','match','once') b=regexprep(a,'\S+Bacon\S+','') out=s(~cellfun(@isempty,b))

9 years ago | 1

Answered
equivalent of "a(b==1,:) = 3" for cellarray
b= {'a' 'P1a'; 'b' 'P1b'; 'c' 'P1a'; 'd' 'P2asdf'; 'e' 'P2sd'; 'f' 'P3hm' } a=str2double(regexp(b(:,2),'\d+','match','once'))...

9 years ago | 1

Answered
Associate index of equal element in two arrays
for k=1:numel(A) [ii(k),jj(k)]=find(B==A(k)) end

9 years ago | 2

Answered
Merge matrices by matching first column values in MATLAB?
A= [4 5.3 5 7.3 8 2.5 9 4.7] B= [1 3.6 0.4 2 3.9 0.6 3 9.2 0.9 4 5.1 0.1 5 0.7 0.5 ...

9 years ago | 0

Answered
How do I find 4 or more consecutive zeros and replace these zero's?
A=[0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 1 1 0 1]' a=cumsum(A)+1 v=cell2mat(accumarray(a,(1:numel(a))',[],@(x) {2*(nume...

9 years ago | 0

Answered
How do I find 4 or more consecutive zeros and replace these zero's?
A=[0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 1 1 0 1]' ii=strfind([1 A'],[1 0]) jj=strfind([A' 1],[0 1]) kk=find(jj-ii+1...

9 years ago | 0

Answered
how to convert 2d to id
A=[5 4 3 8 9 ; 2 1 3 2 5 ;4 3 5 7 6] C=[1; 3; 4] n=size(A,2); m=numel(C); out=A(:); idx=arrayfun(@(x) sub2ind(size(A),x*o...

9 years ago | 0

Answered
How to merge two mat files
A mat file doesn't contain columns but variables. If you mean your two mat files contains a variable 'd' for example, that is nx...

9 years ago | 8

Answered
How to change directory or folder in Matlab in a program?
file=fullfile('second','*.wav')

9 years ago | 1

| accepted

Answered
Files disappearing when trying to use movefile
If you want to move filename.mat from folder1 to folder2 folder1='C:\Users\malek\Documents\path1' folder2='C:\Users\malek\...

9 years ago | 0

Answered
regexp to filter file names
s={'HI_A1C_TTTT4_468_07052016.xlsx' 'HI_B2_TTTT9_Default452_070516.xlsx' 'HI_GA1C_TTTT8_862_07052016.xlsx' 'HI_...

9 years ago | 1

| accepted

Answered
How I can create a vector with specified blanks?
You can set your data to nan Data=rand(4*365,1) % your data idx_gap=10:12 Data(idx_gap)=nan

9 years ago | 1

Answered
Flipping a Cell Array
A(2:m,:)=flipud(A(2:m,:))

9 years ago | 0

Answered
How to create a structure of array with same variable name with different values from different .mat files
f=dir('*.mat') file={f.name} n=numel(file) out=zeros(n,2); for k=1:n d=load(file{k}) out(k,:)=[d.a d.b] end ...

9 years ago | 0

Answered
I want to generate five matrices [5X10] of '0's and '1's with random generation in which each row may contain maximum one '1'. And with some special interdependence between rows.
A=rand(5,10)>0.95 if any(A(2,:)) A(4,:)=0 end if any(A(3,:)) A(5,:)=0 end if any(A(4,:)) A(2,:)=0 end if...

9 years ago | 0

| accepted

Load more