Beantwortet
Why doesn't it work ? Please help
dt = 0.01; t = 4; T = 0:dt:t; % First Quarter r1 = 0:dt:t/4 ; p1 = sin(pi.*r1) ; plot (r1,p1) % Define second Qua...

fast 3 Jahre vor | 0

Beantwortet
matlab polyfit multiple sets of y data
Run a loop for each set..... Let y be your mxn data and x be your 1xn data. p = cell(m,1) ; for i = 1:m p{i} = polyfut...

fast 3 Jahre vor | 0

Beantwortet
Can't run my 'if, elseif, else' code
score= randi(100); if score < 20 grade = 'D'; elseif score < 40 grade= 'C'; elseif score < 60 grade= '...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
cell array into matrix
Read about cell2mat.

fast 3 Jahre vor | 0

Beantwortet
Not enough input arguments
f = @(x,y) x.*y + 10*sin(x).*cos(y); x = linspace(0,2*pi) ; y = linspace(0,2*pi) ; [X,Y] = meshgrid(x,y) ; Z = f(X,Y) ; su...

fast 3 Jahre vor | 1

Beantwortet
can you help me to solve this equation?
syms x P = sqrt(27.8*exp(5*x)-1) == cos((120*x^2+sqrt(2*x))/(17*x-65))^(-1) ; s = vpasolve(P,x)

fast 3 Jahre vor | 0

Beantwortet
Syntax problem with a user-defined function with sine
function r = my_function(thet) r = pi*(3-sin(theta)^5) ; end Save the above, it will be saved on he name my_function.m. ...

fast 3 Jahre vor | 0

Beantwortet
Matrix multiplication gives different result than manual dot products with each column
As you are comparing floatting point number, you should not use isequal. You should proceed like shown below: N = 1000; B = 10...

fast 3 Jahre vor | 0

Beantwortet
How to plot the streamlines and arrow surface in MATLAB from columns of data?
clc ; clear all ; % T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1311670/streamlines%20plot.txt...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
trying to align multiple sin waves onto same graph with the period of the wave on the x axis.
Take same time array for all the waves. g = 9.807; T = 11; H = 4; d = 30; CD = 0.85; CM = 1.77; Rho = 1025; D = 1; u =...

etwa 3 Jahre vor | 0

Beantwortet
Double X-axis(t,p1) and single Y-axis(p2) depending on t
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1309930/b1.xlsx') ; t = duration(T.Time); p1 = T....

etwa 3 Jahre vor | 0

Beantwortet
How to apply the same style/color and axes labels to all subplots?
colors = ["k"; "r";"g";"r";"g"]; lines = ["-"; "-";"-";"--";"--"]; tiledlayout(2,2); ax(1) = nexttile ; plot(rand(10,1)...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
Generating lognormal random numbers
Read about lognrnd

etwa 3 Jahre vor | 0

Beantwortet
How to get the decimal values using solve in MATLAB
Read about vpasolve, double.

etwa 3 Jahre vor | 1

Beantwortet
How do I repeat the comand for another line
dt = dx1./v; % let dt be 10x1 array m = length(dt) ; n = 60001 ; temp0 = zeros(m,n) ; for i = 1:n tempo(:,i) = 0:dt...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Create a point with a number inside
th = linspace(0,2*pi) ; x = cos(th) ; y = sin(th) ; % Make numbers idx = 1:5:length(th) ; figure hold on plot(x,y,'k',...

etwa 3 Jahre vor | 0

Beantwortet
Pulling Vectors From 3D Matrix Based on Indicies
A = rand(30,40,10) ; iwant = squeeze(A(13,33,:))

etwa 3 Jahre vor | 1

Beantwortet
How to have two legends on the same plot?
figure hold on plot(rand(1,10),'r') plot(rand(1,10),'b') legend('One','Two')

etwa 3 Jahre vor | 1

Beantwortet
Please help, I keep getting this error... Error using plot Not enough input arguments.
Months=["Jan";"Feb";"March";"April";"May";"June";"July";"Aug";"Sept";"Oct";"Nov";"Dec"]; EnergyDailyAve = [33.677 76.714 69.6...

etwa 3 Jahre vor | 0

Beantwortet
Calculate area under peak
Read about the functions polyarea, trapz. Provde the (x,y) data of the curve for which you want to calculate the area.

etwa 3 Jahre vor | 0

Beantwortet
How to combine the data from multiple netcdf files and make it one .mat file?
%% List of files list_of_files= dir(fullfile(ddir,'*.nc')) %% Read Rainfall Data filename = fullfile(ddir, list_of_files(1).n...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
Can anyone tell me why I'm getting an error here? "xold=xnew;'' is giving me an error in this statement and I'm not sure why.
These lines: xold=3.5; d=0.01; % Iteration 1 xold=xnew; xnew=xold-d*xold*fx(xold)/(fx(xold+d*xold)-fx(xold)); will obvious...

etwa 3 Jahre vor | 1

| akzeptiert

Beantwortet
Solve the given system of equations using the Gauss-Jordan elimination method with MATLAB.
Read about rref A = [0.1 -2.5 1.2 -0.75 108 ; 2.4 1.5 -1.8 0.25 -81; 0.4 -3.2 1.6 -1.4 148.8; 1.6 1...

etwa 3 Jahre vor | 0

Beantwortet
data_chirp(:,:,1:2:end); what does this code mean???
It means your data i.e. data_chirp is a 3D data. That line extracts all rows, all columns at odd indices of 3rd dimension. To ...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to find largest Peak Values of signal and Save X,Y Values in MATLAB
Read about the function max, findpeaks. The above functions gives you index of the max value, using this index you can get x-v...

etwa 3 Jahre vor | 1

Beantwortet
How to plot cluster group by circles
You may fit a circle to the cluster data using the following fileexchange function. https://in.mathworks.com/matlabcentral/fil...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
How do I onehotencode a table without encoding variable names?
B = table(); for i = 1:size(MyTable,2) B = [B, onehotencode(MyTable.(i))]; end You may consider using width instead of s...

etwa 3 Jahre vor | 0

Beantwortet
How to create 4D array of images
Say you have n images each of size p,q. data = zeros(p,q,1,n) ; for i = 1:n data(:,:,1,i) = image1 ; % loop for each i...

etwa 3 Jahre vor | 1

Beantwortet
sum() missing for certain values
Don't use sum(Vector==x) use tol = 0.0001 ; % set your acceptable tolerance sum(abs(Vector-x)<tol) ;

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
plotting data from multiple sheets by ID and day
fname = 'https://in.mathworks.com/matlabcentral/answers/uploaded_files/1300500/RLC_AD.xlsx' ; sheets = sheetnames(fname) ; ...

etwa 3 Jahre vor | 0

| akzeptiert

Mehr laden