Answered
Representing a set of data points as a Fourier Series
Try this: data = [1 13.38 2 15.33 3 18.11 4 21.15 5 25.74 6 27.89 7 29....

6 years ago | 1

| accepted

Answered
Fitting data into a required function
Try this: x = [0.001 0.01 0.1 1 10]; y = [63.5 74.5 94.1 94.2 103.5]; fcn = @(b,x) b(1).*x.^b(2); B0 = rand(2,1); B = ...

6 years ago | 0

| accepted

Answered
Trouble using integral function
First, it will likely be worthwhile to use element-wise operations (‘dot operators’) in appropriate places (here in the division...

6 years ago | 0

| accepted

Answered
Using an array inside a function
Try something like this, using trapz: SB = randn(512,512,16); % Create Matrix Lambda = 1./(1:16);...

6 years ago | 1

| accepted

Answered
How to apply a appropriate sampleing frequency and cut off frquency for a low pass filter
‘Because I know that the table above provided a sampling frequency of Fs = 0.01 ...’ That is not the sampling frequency. It ...

6 years ago | 1

| accepted

Answered
using splitapply on a table to split a column with repeating rows
See if the unstack function will do what you want.

6 years ago | 0

| accepted

Answered
How can I plot staked cylinders?
I cannot interpret much of your code, so I created my own version to plot the cylinders. You will need to adapt it to what you ...

6 years ago | 1

| accepted

Answered
INT and INTEGRAL wont evaluate definite integral
It will if you use vpaintegral (introduced in R2016b) instead: K_quasistatic=2*sqrt(c/pi)*vpaintegral(b,z,0,c) produces: K_...

6 years ago | 0

| accepted

Answered
Finding weekly mean of temperature data
Use an appropriate function to read the file (readmatrix, or a similar appropriate function), then try this prototype code with ...

6 years ago | 0

| accepted

Answered
One column in return from ode45 is all zero
Assuming that ‘x(8)’ is 0 and not simply a very small value, There’s obviously something about the nested if blocks that’s not w...

6 years ago | 0

| accepted

Answered
add cell or struct as title matlab plot
Since ‘num’ should be a simple character vector (at least it is when I tested this in R2020b), one of these should work: title...

6 years ago | 0

| accepted

Answered
How to plot for this figure?
Define the ‘x’ and ‘y’ vectors differently, then reduce the number of cycles in each direction. The grid lines on the surfaces ...

6 years ago | 0

| accepted

Answered
How to find fwhm for each peak?
The Signal Processing Toolbox findpeaks function can return the FWHM of every peak. See the documentation sections on Determine...

6 years ago | 1

| accepted

Answered
How to show errorbar only for few selected data ?
Try something like this: x = 1:100; y = sin(2*pi*x/50); e = rand(1,10)/10; figure plot(x, y) hold on errorbar(x(1:10:e...

6 years ago | 0

| accepted

Answered
Query about axes of graph created by plot function
I am not certain what the original problem is with your plot. Try this: A = [1 2 3]; B = [1 2 3]; figure plot(A, B) A...

6 years ago | 0

| accepted

Answered
Having trouble to contour plot the results of a matrix.
I am not certain what the problem is. Try this: x = M(1,:); y = M(2,:); z = M(3,:); N = 100; ...

6 years ago | 0

| accepted

Answered
Solve for specific variable - like Excel's solver
The problem is with the single (or any other) quotes. Remove them, and then: syms x t = solve(2*x+6==0, x) produces: t ...

6 years ago | 0

| accepted

Answered
Calculate the area between two curves
Try this: x1 = [0;1.55580000000001;2.85504000000000;3.82563000000000;4.82445000000000;5.79351000000000;6.79326000000000;7.8028...

6 years ago | 0

| accepted

Answered
Obtain contours with a 3D geometry and a contour function in a 3D space
I would use contour3 to plot contours in 3D. I have no idea if it would reproduce the figure in your Question, however it is de...

6 years ago | 1

Answered
trying to take FFT of a signal but not getting the correct result
Perhaps calling the fft function would get you closer. Example — t{1}=load('201710h1.lvm'); %test 1 t{2}=load('201710h2....

6 years ago | 0

| accepted

Answered
how to use partial derivative in fraction form in latex intepreter
Try this: figure text(0.5, 0.5, '$ \frac{\partial_{u}}{\partial_{x}} $', 'Interpreter','latex', 'FontSize',25) For more info...

6 years ago | 0

| accepted

Answered
How to plot Schrödinger equation?
Use element-wise operations in the code you write for it (see Array vs. Matrix Operations for details), and use meshgrid or ndgr...

6 years ago | 0

| accepted

Answered
Axis labels cover the figure
This is a bug that has since been fixed. See semilogx() with reverse X Axis changes Y Labels position for a work-around, or upd...

6 years ago | 0

| accepted

Answered
Solve ODE with a time dependent parameter
Using discrete values for ‘Iapp’ is likely not appropriate because of the adaptive algorithms used in the MATLAB ODE solvers. ...

6 years ago | 0

| accepted

Answered
Signal segmentation error: how to select a specific number of points before and after the ECG signal?
See How do I find and plot the average of action potentials from a trace? for an appropriate approach. Substitute your EKG vec...

6 years ago | 0

| accepted

Answered
help solving an equation using fzero
Since you specifically asked for help on fzero, this works: X = 1; for k = 1:numel(theta_tw) T_75(k) = fzero(@(theta_75)...

6 years ago | 0

| accepted

Answered
How can I define the following functions using inline command?
See the documentation section on Anonymous Functions.

6 years ago | 0

Answered
Need help using mink and maxk
The mink and maxk functions can give the indices of those values as the second output. If I understand correctly what you wan...

6 years ago | 1

| accepted

Answered
how to plot linear regression ?
Try this: figure plot(T,vp,'or',T,10.^y,'b') xlabel('T (C)') ylabel('vp (mm Hg)') The rest of the code is unchanged.

6 years ago | 0

| accepted

Answered
How to graph my calculations
Subscript the variables in the loops: Ntheta(i) = real(sqrt((g./RHOavg(i)).*(dptheta./dz))); and similarly for the others in ...

6 years ago | 0

Load more