Answered
undefined function or variable x
Save the below code in a file as myfunction.m and run it. function myfunction() % solution of second-order differential equ...

6 years ago | 0

Answered
Not enough input arguments.
It seems you are striaghtaway running the function predictknn using run button. You should not run/ call a function like this. ...

6 years ago | 0

Answered
How can I solve it ?? Help please
f = @(t) sin(2*t)-6*t+cos(t) ; t = linspace(0,1,10^6) ; y = f(t) ; t0 = t(abs(y)<=10^-6)

6 years ago | 0

Answered
Interpolating function to make two arrays synchronise
x = Init_Density(1:end); y = Depth; xi = linspace(min(x),max(x),600); yi = interp1(x,y,xi);

6 years ago | 0

| accepted

Answered
How can I solve it ?? Help please
syms t eqn = sin(2*t)-6*t+cos(t)==0 ; s = solve(eqn,t)

6 years ago | 0

Answered
Number of points that passes a line
You can calculate the intersection points of your (x,y) data and the given line. To find the intersection points you can use thi...

6 years ago | 0

| accepted

Answered
How to plot this figure?
REad about stem. y = rand(1,10) ; stem(y) xlabel('x') ylabel('y')

6 years ago | 1

| accepted

Answered
Picking out a specific time period from a NetCDF file?
Read the time data from netCDF file Convert them into datevec, and pick the years you want using ismember or logical indexing. ...

6 years ago | 0

| accepted

Answered
I have separate column vectors of dd, mm, yyyy, HH and MM, how do I combine them into the format dd-mm-yyyy HH:MM to plot on the x axis
Read about datetime. https://in.mathworks.com/help/matlab/ref/datetime.html

6 years ago | 0

Answered
Count values on an image inside a rectangle
Read about inpolygon. You will get all the indices of the points lying inside this reactange. Then you can count them. Use inte...

6 years ago | 0

Answered
extract data from table
LEt A, B be your two matrices. iwant = A(B(:,1),:);

6 years ago | 0

| accepted

Answered
Sketch the resulting function of time.
If you have time variable t in hand...you can do : t0 = 1 ; t1 = 10 ; t = linspace(t0,t1,100) ; f = @(t) 1/5*(exp(-3*t)-ex...

6 years ago | 0

Answered
Dimensions of arrays being concatenated are not consistent
R1 = input('Input the value of R1: '); R2 = input('Input the value of R2: '); R3 = input('Input the value of R3: '); R4 = inp...

6 years ago | 0

| accepted

Answered
distance between array and matrix
Read about pdist2. A = rand(3,480) ; d = pdist2(A',A') ; % required distances

6 years ago | 0

| accepted

Answered
can anyone help me in plotting the graph for this euler's method question?
clear all clc f=@(t,v)9.81-(7/2125)*v^2; t0=0; v0=0; tn=20; h=2; t = t0:h:tn ; v1 = zeros(size(t)) ; v1(1) = v0 ; ...

6 years ago | 0

| accepted

Answered
How to create a circulant matrix column wise?
You can refer this fileexchange: https://in.mathworks.com/matlabcentral/fileexchange/22858-circulant-matrix

6 years ago | 0

Answered
How to make hatch in the polygon ?
Try this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/2075-hatch-m

6 years ago | 0

| accepted

Answered
Can anyone help me with this?
read excel data in matlab: Read about xlsread, readtable to read the excel data into MATLAB workspace. 2. plot all hourly me...

6 years ago | 0

| accepted

Answered
How can I plot and label 4 lines from 1 vector?
Read about reshape, plot and legend. A = rand(1,124) ; B = reshape(A,[],4) ; % reshape into 4 columns plot(B) legend("...

6 years ago | 0

| accepted

Answered
how can i create and plot a vector with elements that are randomly distributed within two regions ?
clc; clear all ; C = [0 0] ; R1 = 10 ; R2 = R1+6 ; th = linspace(0,2*pi,500) ; x1 = C(1)+R1*cos(th) ; y1 = C(2)+R...

6 years ago | 1

Answered
Last else if graph not plotting
Try like this: hold on if i==3600 plot(x,C); elseif i==10...

6 years ago | 0

Answered
how can i reshape an indexed vector
Whn you use find you will get the global indices in the form of column array...YOu can use logical indexing, so that you can hav...

6 years ago | 0

Answered
Surface chart using surf
Try surf(teta_i,f_vector,Ef_teta_T2);

6 years ago | 0

| accepted

Answered
Copy and paste the values in the row of matrix to another row in same matrix
Let A be your 1000*4 matrix and B be other matrix whih has four columns. Assuming that B has lot many rows. B(5081:5280,:) = A...

6 years ago | 0

Answered
How do I use scatter to make a bubble plot in Matlab for a 112 x 112 matrice in Matlab?
You can use scatter ..it will set the colors automatically.... Also have a look on pcolor, surf, gscatter.

6 years ago | 0

Answered
RANDOM NOISE IN MATLAB
You can check this on your self....there is difference in the distribution of rand and randn. % rand has uniform distribution ...

6 years ago | 0

Answered
How can i save a circle coordinates in a matrix?
R = 0.01; % Radius C = [90. 0.] ; th = (0:1:360)' ; x = C(1)+R*cosd(th) ; y = C(2)+R*sind(th) ; z = zeros(size(th)) ;...

6 years ago | 0

Answered
Cases function: why do I get this message "array indices must be positive integers or logical values"
You should use logical indexing. Try something like this: t = linspace (-5, 5, 1001); x1 = zeros(size(t)) ; x1(abs(t)<=1) =...

6 years ago | 1

Answered
PLOTTING CUMILATIVE DISTANCE VS TIME GRAPH
You can find the distance between two given points (x1,y1) and (x2,y2) using: Also have a look on pdist, pdist2. Once you hav...

6 years ago | 0

Answered
ODE error Array indices must be positive integers or logical values.
The indices for an array in MATLAB should be posititve integers or logicals. If you give fractions, 0, negative as index it wil...

6 years ago | 0

Load more