Réponse apportée
Read multiple excel files and get the maximum value
files = dir('*.csv'); N = length(files) ; % initialize the required maximum array max2010 = zeros(N,3) ; for i = 1:length...

presque 4 ans il y a | 0

Réponse apportée
Plotting a histogram (setting the color) with a fit distribution
H = histogram(A,'facecolor', [0 1 1], 'facealpha',.1,'edgecolor','k'); h = histfit(A) ; % get the data of hist-fit x = h(2)...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Index in position 1 is invalid. Array indices must be positive integers or logical values. Error in temp = G(i,j)./(1+(i-j).^2);
What is y and z? Are they arrays or some numbers? If numbers, they shoul dbe positive, integers. Because MATLAB takes positive...

presque 4 ans il y a | 0

Réponse apportée
reading a n row excel file and making a matrix
REad about readtable

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to apply a For loop for climatology time series analysis?
Read about retime. If not, also you can calculate the mean you want using mean.

presque 4 ans il y a | 0

Réponse apportée
NaN at (5,0) in graph. How to change it? Electric field
You can fill the NaN's using fillmissing Read about this function. x = -24:18; y = (-20:2:18).'; E0 = 8.85e-12; k = 1/(4*pi...

presque 4 ans il y a | 0

Réponse apportée
2-D colormap (loading .txt files)
thepath = 'kx values\*.txt' ; files = dir(thepath) ; N = length(files) ; data = cell(N,1) ; for i = 1:N file = fullf...

presque 4 ans il y a | 0

Réponse apportée
Using vertcat for cell array of differing length
% Make dummy data for demo A = cell(3,2) ; for i = 1:3 for j = 1:2 N = randperm(10,1) ; A{i,j} = ran...

presque 4 ans il y a | 1

Réponse apportée
Plotting the content of huge matrix.
You need not to use scatter in a loop. You can do all this at one go using scatter or you can use pcolor as shown below. x = li...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to arrange this code to run
d0 = [0,0]; v0 = [2,3]; a0 = [0,0]; dt = 1e-3; n = 9001; Mass = @(d,v,a) mass(d,v,a); Damping = @(d,v,a) damping(d,v,...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How do I add the numbers on top of the bar graph?
A = rand(3,1) ; h = bar(A) ; text(h.XData,h.YData+0.05,num2str(A)) ;

presque 4 ans il y a | 0

Réponse apportée
Forward Euler method error
The loop should be taken as: for i = 1:round(N) In your present case, it is a fraction and you are getting non integers as the...

presque 4 ans il y a | 0

Réponse apportée
Obtain coordinate of a vector or multivalued function
It should be v(i) not v[i]. Read about MATLAB indexing. f=@(a,b,c,d) [a.^2-b+c+d,a-b.^2+c+d.^3,a.*b.*c.*d,a-b-c-d]; % anonymou...

presque 4 ans il y a | 0

Réponse apportée
Filter an image to obtain certain pixels and retrieve their original [row,col]?
idx = find(Img>0) ; [row,col] = ind2sub(size(Img),idx) ;

presque 4 ans il y a | 1

Réponse apportée
How can I represent this equation on MATLAB
Extend the example to your case. n = 100 ; t = linspace(0,4,n) ; x = 2*sin(3*pi*t) ; plot(t,x)

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Plotting meteorological data on Geographic maps
You can download the shape files here: https://gadm.org/download_country.html To read shape files, use shaperead. You can pl...

presque 4 ans il y a | 0

Réponse apportée
Count number of particles within a given radius
REad about knnsearch, rangesearch and inpolygon.

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Delete rows with zero after importing several files
If you want to remove rows which have zeros in specific columns do: c = 2; % column to check for zero idx = Ratio(:,c)==0 ; ...

presque 4 ans il y a | 0

Réponse apportée
Error saying matrices are not the same size
I think the loop should be something like this: for i = 2:length(t)-1; w(i,:) = w(i-1,:)+h*f(t(i),w(i-1,:)) ; end In yo...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to create bar graph with formula and have nan in the import excel?
Read about fillmissing. You can fill the gaps/ NaN's using that function.

presque 4 ans il y a | 0

Réponse apportée
FFT of Acceleration data stored in excel file
To load the data use readtable To get fft read about fft.

presque 4 ans il y a | 0

Réponse apportée
Find the position matrix of boundary points in an image
You can do it manually using getpts, ginput. Read about these functions. If you want to do it automatically, you can get the whi...

presque 4 ans il y a | 0

Réponse apportée
How do I find the values at a specific Y value on a 3-D surf plot?
Read about slice. Also you can find the index of your required points and extract the required values.

presque 4 ans il y a | 0

Réponse apportée
How to choose surface point in 3D plot
REad about delaunaytraingulation, once mesh is formed you can use patch or trisurf. If you could do fine, else attach your data....

presque 4 ans il y a | 0

Réponse apportée
When do you use periods with operators?
If you are doing scalar operations, then periods are not needed. a = rand ; b = rand ; a*b a^b If you are doing array ope...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Plotting 4D surface plot (x,y,z and one is colour bar)
A = [-0.5788245 0.30687669 0.22984767 0.22355179 -0.1582685 0.29329778 0.24892007 0.22159881 -0.6557496 0.308436399 0.22769311...

presque 4 ans il y a | 0

Réponse apportée
Calculate distance from geographics points
USe Haversine's formula: Let (lon1,lat1) and (lon2,lat2) be your coordinates in degrees. % Haversine formula dlon = lon2 - l...

presque 4 ans il y a | 1

Réponse apportée
how to multiply a curve (in a plot) by -1, if you do not have the original data? (I only have the plotted data.)
https://in.mathworks.com/matlabcentral/answers/383567-how-to-extract-x-y-data-values-from-matlab-figure https://in.mathworks.c...

presque 4 ans il y a | 0

Réponse apportée
intensity plot x-y plane
Read about pcolor, surf. Your code is a mess, it needs lot of changes. You shoul dinitialize the arrays which are getting fi...

presque 4 ans il y a | 0

Réponse apportée
command or how to obtain best real root of a polynomial with given unknown coefficient.
syms x a b c d e p = a*x^4+b*x^3+c*x^2+d*x+e==0 s = solve(p,x)

presque 4 ans il y a | 0

Charger plus