Réponse apportée
I have to find the maximum element in a two dimensional array and replace it with 0.
A=randi(10,5,6) A(A==max(A(:)))=0

plus de 7 ans il y a | 2

Réponse apportée
Pareto chart in matlab for N x M matrix
What do you mean by this "What approach do i have to take in-order to achieve this"? If you have M*N matrix, then you can chang...

plus de 7 ans il y a | 2

Réponse apportée
how to solve mismatch data types
I dont understand your question fully. But I think this might helps you. >> a=8 a = 8 >> int3...

plus de 7 ans il y a | 2

Réponse apportée
How can i use the Enter button to run the program?
Use *Ctrl+Enter* to run the your program. Actually its there to run the current section of your program. If you didn't split...

plus de 7 ans il y a | 2

Réponse apportée
error in using the sum function
You have already defined sum as a variable clc clear m=5; %number of groups n=10 %size of each group sz=[m n]; ...

plus de 7 ans il y a | 2

Réponse apportée
Unzipping a uint8 array
Use unzip(zipfilename) unzip(zipfilename,directory) Reference: <http://matlab.izmiran.ru/help/techdoc/ref/unzip.html>

plus de 7 ans il y a | 2

Réponse apportée
Conditional with string wildcard
I have taken names as filename. full_name='Tree' Text2 = 'Tree'; %here is you mistake. Remove * from the last ...

plus de 7 ans il y a | 2

Réponse apportée
access sequence of file with date increment
This answer is not going to specific only for WRF output files, but for all. First read all files and store their names in a va...

plus de 7 ans il y a | 2

Réponse apportée
How to use datenum with a date represented as a scaler?
If A is numeric, then A=20180924 a1=num2str(A) datenum(str2double({a1(1:4),a1(5:6),a1(7:8)})); If you wish to ...

plus de 7 ans il y a | 2

Réponse apportée
Interpolation from coarse to fine grid
Hope this helps. The below code convert data over finer grids as well as it does vertical interpolation too. lat=[65:1:75]...

plus de 7 ans il y a | 3

Réponse apportée
How do I add elements to a structure in a loop?
Just simple store separated with dot. Example for ii=1:15 [a,b,c]=polyfit(randi(20,1,100),randi(10,1,100),2) ...

plus de 7 ans il y a | 2

Réponse apportée
can anyone tell me how to plot a three curves with different x and y values for all curve in single plot?
As you have not given any specific data set. I am taking a random data to give you an example. *Example 1* Just plot all t...

plus de 7 ans il y a | 2

Réponse apportée
i have a data of 1152*3*140 trials(where 1152 is no of sample points , 3 is no of channels ,140 is no of trials) of two classes of elements , i need to separate each class indivdually for particular trials of each channel ? like 1152*1*no of trials
A=rand(1152,3,140); AA=arrayfun(@(x) squeeze(A(:,x,:)),1:size(A,2),'uni',0); AA splits A into three parts, each of d...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
How can I calculate a portion of my data's average?
" I will not necessarily know how many data points are in each section" Lets take a random sets in which you want to take avera...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
How to add serial number and some other constant values to my output?
You can simple add a column at the front of your matrix and use dlmcell to write in a text file. Suppose A is you cell matri...

plus de 7 ans il y a | 2

Réponse apportée
how to interpolate x with y and vice versa ?
Try using interp2, spline or pchip. "interpolate first coloumn with second" ???? Lets see an example. A contains the data o...

plus de 7 ans il y a | 2

Réponse apportée
How can I split a matrix into N different parts?
Firstly change data into polar coordinates, so that your complete data will change into angles and radius. After conversion, you...

plus de 7 ans il y a | 2

Réponse apportée
How to plot spatial correlation map in Matlab?
Please refer to <https://in.mathworks.com/matlabcentral/answers/358844-spatial-correlation-between-two-variables this problem> ....

plus de 7 ans il y a | 2

| A accepté

Question


structfun to read the filenames
F=dir('*.nc') for ii=1:length(F) case_name{ii,1}=F(ii).name; end Can we write the above code without using loo...

plus de 7 ans il y a | 1 réponse | 2

1

réponse

Question


A(B)=[] in anonymous function
A=randi(100,1,100); A(randi(100,1,10))=[]; The above code works well but how to write it in an anonymous function. ...

plus de 7 ans il y a | 1 réponse | 1

1

réponse

Réponse apportée
output of interp2 is single - why?
It's because of your xb,yb,zb, xcovis and ycovis are single. If you want your output in double, just use double before using int...

plus de 7 ans il y a | 1

Question


Significance of writing (_,'uni',0)
A' ans = 1×10 cell array '16' '16' '16' '4' '17' '17' '6' '9' '17' '17' ...

plus de 7 ans il y a | 1 réponse | 1

1

réponse

Question


Is this right way of integrating throughout the depth
I have to integrate matrix A throughout the depth. [integration from depth to top] of A A=[0 .00852,0.00957,0.01550,0.0...

plus de 7 ans il y a | 1 réponse | 1

1

réponse

Question


Running bash commands in MATLAB command window
Is there any way to run all linux commands in MATLAB. I have installed few more programming language in linux. Can I use ...

presque 8 ans il y a | 1 réponse | 1

1

réponse

Réponse apportée
4 dimensional matrix multiplication
Use this function from file exchange <https://in.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multiply-...

presque 8 ans il y a | 1

Question


Divide a matrix with an array along a specific dimension
A=rand(10,20,30); B=[1:30]; I want to divide A with B along the third dimension. I got the required result using loop. ...

presque 8 ans il y a | 2 réponses | 1

2

réponses

Réponse apportée
Separate yearly data into months in different columns
"Jan 1999 in one column then Feb 1999 in 2nd and so on till Dec 2003......" This never be possible because the length of elemen...

presque 8 ans il y a | 2

Réponse apportée
Represent Data in Circle with Colormap
You can define your own colormap or you can use predefined colormaps too colormap jet(15) %if you want 15 colors on t...

environ 8 ans il y a | 1

Réponse apportée
How to plot multiline with variable inputs
Up to my understanding of your question, I think you are struggling to plot. You can try this one. Sorry, if I misunderstood ...

environ 8 ans il y a | 1

Réponse apportée
histcounts error in place of histc
Try this. A=randi(5,1,15) a=histcounts(A) bar(unique(A),a) If you are facing problem using histcounts, then yo...

environ 8 ans il y a | 1

Charger plus