Answered
Fprintf modification in matlab
Those are all preferences. See the Fonts section. There is no other way (to my knowledge) to change them. Also, I poste...

6 years ago | 0

Answered
Need help.... How to plot sequences
The mod function and the colon,: operator are your friends!

6 years ago | 0

| accepted

Answered
sampling time causes scaling of simulation results.
It may be appropriate to specify the the sampling time in the ss call. See Create Discrete-Time State-Space Model. Another p...

6 years ago | 0

| accepted

Answered
How can we do for following fprintf formating
Try this: fprintf('\tx%c\n', char(178)) producinig: x² .

6 years ago | 0

| accepted

Answered
How to plot point clouds and linear regression line in the same plot?
Use the hold function.

6 years ago | 0

Answered
How to Solve an Equation with an Integral for the Integral Range Parameter?
The gammainc function does not take complex arguments, so this is likely the best you can hope for: F = @(S) S - 0.01 * gammai...

6 years ago | 0

| accepted

Answered
ODE45 to solve a 2nd order differential equation with a parameter that changes in time
Interp[olate to find the appropriate values of ‘heave’ (that I call ‘heavet’ in ‘pitchODE’ ‘dxdt2’): function [dxdt] = pitchOD...

6 years ago | 1

| accepted

Answered
Percentiles without Statistics Toolbox
Try this: x = 3*randn(1,100)+5; % Create Data figure yyaxis left h = hi...

6 years ago | 1

| accepted

Answered
error with function bode
Rename your ‘conv.m’ file to something else, perhaps to ‘myconv.m’ or to something else that makes sense in the context of its u...

6 years ago | 0

Answered
Sorting time in 1 hour time slots.
One approach: A = datetime([zeros(100,4) randi(1440, 100, 1) zeros(100,1)]); % Create Data [H,~,ix] = unique(hour(A)...

6 years ago | 0

Answered
why is my plot plotting blank?
The value of ‘Cd’ is 0 in the code you posted, so ‘y’ is uniformly -Inf.

6 years ago | 0

Answered
How to get spatial frequency from FFT?
The Fourier transform neither knows nor cares whether the units of the independent variable are time, space, or anything else. ...

6 years ago | 1

| accepted

Answered
How to plot particle trajectories and normalise to 0,0 origin?
This will normalise everycell to begin at (0,0): testdata = readmatrix('Amadeus Xu testdata.xlsx'); [Uid,~,ix] = unique(testd...

6 years ago | 1

| accepted

Answered
How can I mix two signals in MATLAB?
Ther esult would appear to be a single-sideband suppresed-carrier signal (with only the upper sideband). See if the demod funct...

6 years ago | 0

Answered
How can I import from Excel CSV
Use readtable to read it: T1 = readtable('sample.csv', 'VariableNamingRule','preserve', 'HeaderLines',22); The 'Headerlines' ...

6 years ago | 0

| accepted

Answered
Smoothening the data of Iv loop
That looks like a hysteresis loop. See if the approach in how to find ascending and descending of hysteresis loop? will fit it ...

6 years ago | 0

| accepted

Answered
Fitting data with multiple inputs, ODE equation, and lsqnonlin
The fundamental problem is that lsqnonlin ~= lsqcurvefit! They are definitely not interchangable, and have different argument l...

6 years ago | 1

| accepted

Answered
Matlab not recognizing dates
You did not mention how you were importing them. Try importing them this way: dv = {'202011' '202012'} datetime(d...

6 years ago | 0

| accepted

Answered
How to generate one square pulse?
Try this: sqpuls = @(t,t1,t2) (t>= t1) & (t <= t2); t = linspace(-1, 1); figure plot(t, sqpuls(t, -0.5, 0.5), '-r') gr...

6 years ago | 0

Answered
How can I change the format of the answer?
I am not certain what you want. Try the vpa funciton: dphi = vpa(dphi, 5) producing: dphi = (1.25e-7*s^2 + 2.0438e-13)/...

6 years ago | 0

| accepted

Answered
Only getting zero as my output for ode45
Give it something other than 0 as the intial condition, for example: X0 = 0+eps; That worked when I tried it.

6 years ago | 0

Answered
How to choose population and generations for GA?
I use an optimoptions structure for this. Example — PopSz = 500; Parms = 3; opts = optimoptions('ga', 'PopulationSize',Po...

6 years ago | 0

| accepted

Answered
Array inputs in lsim function
Likely the easiest way is to create an (Nx3) matrix for ‘u’, with the constant inputs as constant vectors: N = 3501; u = [one...

6 years ago | 0

| accepted

Answered
How to correctly read in a csv file using csvread?
Since you have R2020b, use readtable instead. (Also, note that Update 2 has recently been released.)

6 years ago | 1

Answered
why failed to called filtfilt using design.bandpass result
The filtfilt function is working correctly, and will do what you want with the correct inputs: fdata=filtfilt(Hd.sosMatrix,1,d...

6 years ago | 0

| accepted

Answered
Error using lsim, problems setting 'U' matrix.
I am not certain what the problem is, other than there is a typographical error in the ‘u’ assignment with ‘t’ inastead of ‘T’: ...

6 years ago | 0

Answered
State space models are same?
See if using the minreal function on both makes them equivalent. I am not certain how to compare them beyond that.

6 years ago | 0

Answered
Segmenting QRS complexes.
Do this in code instead. See Average of Wave from 10 waves in single graph for a relevant example.

6 years ago | 1

| accepted

Answered
Converting and plotting serial number to time format [hh:mm]
Ideally, there should be a date as well. In the interim: t = [0.295775463 0.02849537 0.026967593]; DT1 = d...

6 years ago | 0

Answered
EEG signal division into windows
To divide the signal, use the buffer function. Calculating the number of samples is straightforward: n = 90 * Fs; ...

6 years ago | 0

Load more