답변 있음
How to create an array from multiple and identical arrays using double for loops
This can be achieved with function max. Read max

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

답변 있음
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)...

대략 4년 전 | 0

| 수락됨

답변 있음
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...

대략 4년 전 | 0

답변 있음
reading a n row excel file and making a matrix
REad about readtable

대략 4년 전 | 0

| 수락됨

답변 있음
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.

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 1

답변 있음
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...

대략 4년 전 | 0

| 수락됨

답변 있음
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,...

대략 4년 전 | 0

| 수락됨

답변 있음
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)) ;

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

답변 있음
Filter an image to obtain certain pixels and retrieve their original [row,col]?
idx = find(Img>0) ; [row,col] = ind2sub(size(Img),idx) ;

대략 4년 전 | 1

답변 있음
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)

대략 4년 전 | 0

| 수락됨

답변 있음
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...

대략 4년 전 | 0

답변 있음
Count number of particles within a given radius
REad about knnsearch, rangesearch and inpolygon.

대략 4년 전 | 0

| 수락됨

답변 있음
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 ; ...

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

| 수락됨

답변 있음
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.

대략 4년 전 | 0

답변 있음
FFT of Acceleration data stored in excel file
To load the data use readtable To get fft read about fft.

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

답변 있음
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.

대략 4년 전 | 0

답변 있음
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....

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

| 수락됨

답변 있음
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...

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 1

답변 있음
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...

대략 4년 전 | 0

답변 있음
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...

대략 4년 전 | 0

더 보기