Answered
The file I need to import has the dates separated by colons and 'readable' will not recognize them as dates.
Unfortunately, datetime has problems with unconventional delimiters. Try this: fidi = fopen('20190725_20190729_.txt'); k =...

6 years ago | 0

| accepted

Answered
how to code matrix multiple time with different result and fill the next column
I have no idea exactly what you are doing, however this approach will create your matrix: RB = 5; for k = 1:RB SNR = ran...

6 years ago | 1

| accepted

Answered
Matlab doesn't recognise sigshift
See: Undefined function or variable 'sigshift'. how can i shift the signal?

6 years ago | 0

Answered
Fitting Excel data in Matlab
Use the readmatrix or other appropriate function, then go from there: D = readmatrix('student-mat.csv'); Note that ‘D’ is a (...

6 years ago | 0

| accepted

Answered
Equivalent of zero padding in frequency space
Since zero-padding in the space domain increases the frequency resolution in the frequency domain, the equivalent in the frequen...

6 years ago | 0

| accepted

Answered
the problem is the graph comes up as blank
Initialise ‘cd’ with eps instead of 0, subscript ‘cd’ and ‘ut’, iterate over ‘k’ and not ‘Dp’ (since you need to store the value...

6 years ago | 0

| accepted

Answered
Solving sytem of ODE's
The only problem I see is that ‘P1’ should be divided by ‘M1’ ... f = @(t,z) [z(2); z(2)*(-D1/M1)+P1/M1-(a12/M1)*sin(z(1)-z(3))...

6 years ago | 1

| accepted

Answered
Why am I getting a blank graph
I changed the plot call to use 'y' instead of 'q' (that doesn’t exist), and eliminated the clear all and clc calls, and changed ...

6 years ago | 0

| accepted

Answered
Plotting an exponential exp(-x), in 3D?
Try this: r = linspace(0.5, 5, 50); a = linspace(0, 2*pi, 60); [R,A] = ndgrid(r,a); Z = exp(-R); [X,Y,Z] = pol2cart(A,R,...

6 years ago | 5

| accepted

Answered
How to write piecewise function in matlab for the following function. Please give me matlab code.
Creating an anonymous function for ‘T’ is much easier and faster than using piecwise and the Symbolic Math Toolbox for this: z...

6 years ago | 1

| accepted

Answered
Can I pass 2 equations into nlinfit function?
If I remember correctly, nlinfit cannot, however lsqcurvefit can: This works: x = 1:10; y1 = rand(1,10); y2 = rand(1,10); ...

6 years ago | 0

| accepted

Answered
ODE45 solver, with changing initial conditions
This runs without error. You need to determine if it produces the desired result: syms y x epp t v %cases vM = 1; %Max's ...

6 years ago | 0

| accepted

Answered
For loops with if statements
The if conditions can only be evaluated as paired comparisons in order to get the result you want. Try this: e=0:200:55000;...

6 years ago | 0

Answered
find the intersection points?
Add these ines: curv_dif = um - um2; % Subtract Curves idx = find(diff(sign(curv_dif))...

6 years ago | 0

| accepted

Answered
ODE45 specific time point settings
I verified that this version works, however I do not see any significant change in the integrated results. These added lines:...

6 years ago | 0

| accepted

Answered
Help solving and plotting dofferential equation
It appears to me to be a simple separable differential equation. The Symbolic Math Toolbox: syms T(t) t T0 Eqn = diff(T) ...

6 years ago | 0

Answered
Use ODE45 with a frequency span instead of time?
It does not require that the independent variable be time. It can be whatever your differential equation system requires. If y...

6 years ago | 0

| accepted

Answered
How do I call function with the same name from different toolbox?
Use the tf function from the Signal Ptocessing Toolbox: lpFilt = designfilt('lowpassiir','FilterOrder',8, ... 'Passb...

6 years ago | 0

Answered
How to write a text in INPUTDLG without a field?
That does not appear to be an option. Try this: prompt = {'Node A: x:', 'Node A: y:', 'Node A: z:', 'Node B: x:', 'Node B: ...

6 years ago | 0

| accepted

Answered
Invalid Expression "3.57e2.1"
You can certainly calculate it: 3.57*(10^2.1) evaluated as: 4.494363720105178e+02 however you must do it as you wrote it, ...

6 years ago | 1

Answered
Hold on not working for plotting transfer function MATLAB
All the curves are plotted, however some overplot others given the limited resolution. Change the plot call to: plot(t(y>1E...

6 years ago | 1

| accepted

Answered
Is it possible to plot a filled surface on matlab?
Try this: [X,Y] = ndgrid(-2:0.1:2, -1:0.05:1); Z = 4 - X.^2; figure surf(X, Y, Z) hold on surf(X(Y==+1)*[1 1], Y(Y==+1)...

6 years ago | 0

| accepted

Answered
How to implement improper transfer function in Simulink? Help!
See: How can I implement an improper transfer function (without delays) in Simulink? Not recent, however it likely still appli...

6 years ago | 0

Answered
double quote not single quote
Re-format your desired ouitput using the sprintf function.

6 years ago | 1

Answered
Vapour - Liquid equilibrium tie line
The code you posted still does not work with 0.25 and 80. This uses 110 instead of 80 to illustrate the approach. Make the a...

6 years ago | 1

| accepted

Answered
maximum value not evaluating
Since ‘P_ave_output’ is not defined as function, MATLAB interprets the current syntax as a subscript. Try this: plotMax = v...

6 years ago | 0

| accepted

Answered
finding frequency and domain of equation using ode45
Try this: vdp1 = @(t,u) [u(2);-u(1)-((u(1))^3)]; tv = linspace(0, 60, 5000); a=0.1:0.1:0.3; zci2 = @(v) find(diff(sign(v)))...

6 years ago | 0

| accepted

Answered
Error bars on grouped bar plots
Try this: PPdata = [960.6 960.3 960.4; 960.5 960.7 960.7]; PPerr = [0.4 0.4 0.5; 0.1 0.1 0.1]; % PPx=categorical({'\it CL','...

6 years ago | 1

| accepted

Answered
empty sym 0-by-1
The problem is one that you couldn’t have anticipated, and that it took me a while to discover. It apparently has to do with fr...

6 years ago | 0

| accepted

Answered
How can I increase the vertical size of subplots?
I got this to work with the previous code, however I couldn’t get it to work with the code you posted. You will need to make th...

6 years ago | 0

| accepted

Load more