Answered
Help making a 2D color plot
Your problem statement appears to have eliminated most solutions. Try this: x = rand(10,1); y = rand(10,1); z = rand(10,1...

6 years ago | 0

| accepted

Answered
Help speed up this inner loop
See my Answer to: Help me make this small inner loop faster - more efficient notation or functions?

6 years ago | 0

Answered
Help me make this small inner loop faster - more efficient notation or functions?
Using eval is not only not necessary, it will cause problems. I would do something like this instead: z = complex(rand,rand)...

6 years ago | 1

| accepted

Answered
How to change the colour of my line code
The easiest way to set them all to the same colour is to subscript both the ‘d’ handles: d(n)=plot(t,y); then after the loop ...

6 years ago | 1

| accepted

Answered
Notch Filter Using Z-Transform Equations and Filter Functions Only
Your filter works correctly, although your function for analysing and plotting the filtered result fails. Try this: %filt_1...

6 years ago | 0

Answered
Combine 5 datasets into single file
Create the worksheets in different tables, then use the outerjoin function to combine them. Use the subject ID for the ‘Key’. ...

6 years ago | 0

Answered
Plot multiple lines in 3d using x,y,z start point and x,y,z end point
The function to plot them is plot3. Try this: startPts = rand(5,3)*10; % Columns: [x(:) y(:) z(:...

6 years ago | 1

Answered
Modelling a system of ODEs and need to add inputs after t=0?
I am not exactly certain what you are doing or what your pharmacokinetic model is. Not knowing more, I would do something like ...

6 years ago | 1

| accepted

Answered
I want to remove the noise of this Signal
If you have R2017a or later, use the smoothdata function: D = load('matlab.mat'); Temperature = D.Temperature; ys = smooth...

6 years ago | 0

| accepted

Answered
Using solve to solve a complex trigonometric equation
The solve function works best with simplified expressions, since it does not simplify them by default: syms x assume(0 <= x <...

6 years ago | 1

| accepted

Answered
Solving an ODE with time dependent term
See: ODE with Time-Dependent Terms

6 years ago | 0

| accepted

Answered
System of differential equations, unable to find explicit solution with dsolve
Not all differential equations (or integrals) have analytic sollutions. Yours are among them. Try this: % k stands for \ta...

6 years ago | 0

| accepted

Answered
manually coding partial fractions
The Symbolic Math Toolbox partfrac function (introduced in R2015a) will do exactly what you want: syms x Eq = (2*x^5 -2*x^4 ...

6 years ago | 0

Answered
can u help me about square pliss, iam using matlab 2018a
MATLAB is case-sensitive: square .

6 years ago | 0

Answered
I would like plot a decay exponential like this (stable then decaying). tried a couple of methods but it did not work. Please advise given that k=2
Try this: k = log(100/300)/22.5; % Estimate Parameter p = @(t,k) 300.*(t<2.5) + ...

6 years ago | 0

| accepted

Answered
Am I using fplot correct?
The y-axis scales are significantly different, so ‘y2’ will appear to be 0 when it actually is not. Multiply ‘y2’ by a suitably...

6 years ago | 0

| accepted

Answered
Undefined function 'piecewise' for input arguments of type 'double'.
Note that you can easily convert your piecewise symbollic expressions to appropriate numerical expressions. So ‘qh’ and ‘qa’ ...

6 years ago | 0

Answered
Fundamental frequency is not the maximum peak
My pleasure. I’m not certain what your experimental setup is, and whether the ‘transducer’ is a sensor or exciter, since it c...

6 years ago | 0

| accepted

Answered
I need to get the data from this figure
The plot appears to have only Bar objects. Try this: F = openfig('untitled.fig'); Ax = gca; hBar = findobj(Ax.Children, '...

6 years ago | 0

| accepted

Answered
How do I use a squarewave as an input?
Try this: Rs= 17.5; Csa= 0.01; %Csv= 1.75; %t= 5.5998 ;% Q Psa = 99.9958; % Psa Psv= 1.9999; % Psv a=1:0.1:100; y= squa...

6 years ago | 0

Answered
Problem with my matrix dimension in solving nonlinear equations
When in doubt, vectorise every array operation, regarless of how distant they are from the arrays themselves (unless matrix oper...

6 years ago | 1

| accepted

Answered
Plot a precipitation grid, Matlab
Try this: D = [53.2879 -1.57772 1020 53.406 -1.73752 981 53.3642 -1.70167 1002 53.3362 -1.74618 15...

6 years ago | 0

| accepted

Answered
Is it possible to use variables stored in the workspace inside another function ?
The best option is to pass them to the function as extra parameters. See: Passing Extra Parameters for an extended discussion. ...

6 years ago | 2

| accepted

Answered
2d image to 3d surface
Try this: a = imread('Sample.jpeg'); surfc(rgb2gray (a), 'EdgeColor','none') grid on colormap (jet(50)) shading interp se...

6 years ago | 0

Answered
error bar on the graph
The error bars are difficult to see, so I multiplied them by 10 here: x=[2.6,5.2,14,23.3,28.3,2.6,5.2,14,23.3,28.3,2.6,5.2,14,...

6 years ago | 0

| accepted

Answered
Printing table using fprintf
The best you can do is to assign them to a cell array: for i=1:3 T{i}=[t(i+1,:);t1]; end and then address them as ‘T{1}...

6 years ago | 0

| accepted

Answered
How to use low pass filter for 3d plot bathymetry in matlab
If you have R2018a or later and the Signal Processing Toolbox, use the lowpass function.

6 years ago | 0

Answered
How do i resolve this error message?
I cannot determine what you want to do in this assignment: m(i)=5000*dt - m(t-dt); or this one: m(i)=-m(t-dt); since thos...

6 years ago | 0

Answered
[MATLAB R2020a] My legend doesn't have any lines
This appears to be a problem with current AMD graphics card drivers. The easiest solution seems to be: opengl('software') ...

6 years ago | 1

Answered
How to best find whether or not a matrix is made of evenly spaced elements.
I would use: dm = diff(M,[],dim); dmean = mean(dm); dstd = std(dm); where ‘M’ is your matrix, to initially assess them. ...

6 years ago | 0

| accepted

Load more