Answered
How to put subscript/superscript in fprintf?
There is a very limited ability to do that. The ASCII codes for superscripts 1, 2, and 3 are 185, 178 and 179. You can inser...

6 years ago | 3

| accepted

Answered
Mirror pattern of the leading diagonal about the middle element of the matrix
This works for odd ‘n’: dv = @(n) abs(diag(unique(fix(-n/2:n/2)))); % Create Diagonal Matrix n = 5; m5...

6 years ago | 0

| accepted

Answered
Solving system of linear equations, where all answers have to be greater than 0?
See if the lsqnonneg function will do what you want.

6 years ago | 0

| accepted

Answered
MeshDensity: How to exactly set the number of evaluation points of fplot?
‘So, is it possible to set an exact fixed number of evaluation points?’ Likely not with fplot. Since fplot plots single-vari...

6 years ago | 0

| accepted

Answered
Stopband's edges in bandpass IIR filter
This may have more to do with the way fvtool analyses filter Bode plots than the design of the filter itself. (The documentatio...

6 years ago | 0

Answered
Change origin of a mesh
Try this: rows=257; columns=251; x=0:40:columns.*3/4; xmin=x-1; theta=(0:5:360)*pi/180; [th,X]=meshgrid(theta,xmin); th...

6 years ago | 0

| accepted

Answered
Error using "plot" : Data must be numeric, datetime, duration or an array convertible to double??
Apparently, the error is that subplot attempts to plot a transfer function step response without evaluating it. Try this inst...

6 years ago | 1

| accepted

Answered
Error in using contourf
There is an invalid text character: contourf(xx,yy,psi,-1:0.2:1,'k','LineWidth',1.5), hold on�% plot stream function for range...

6 years ago | 0

Answered
How to fit data to a forced oscillation model?
I encourage you to experiment with the file I have attached.

6 years ago | 0

Answered
Excel data import 3D Plot
Try this: num = rand(5,7); % Create Matrix (To Test Code) x = (1:size(num,1)).'; ...

6 years ago | 0

| accepted

Answered
QQplot how to color only some dots of the plot and put a legend for those
Try this: figure h = qqplot(reshape(rand(5,5),[],1)); % Provided Data Data = h(1); Ends = h(3); Be ...

6 years ago | 0

| accepted

Answered
How can I have a Bode plot with poles and zeros shown in it?
Try this: sys = tf([1 0 0 1], [2 3 4 5 0]); % Create System sysdata = tfdata(sys); [plocs,zlocs] = p...

6 years ago | 2

| accepted

Answered
Creating histogram from a datetime vector
I am not certain what your data are or the actual result you want. Try this: DT = datetime('now')+hours(0:72).'; ...

6 years ago | 1

| accepted

Answered
How can I read local ecg file using wfdb app?
Use the fullfile function to generate the file name with the correct path, then use that result as the argument for ‘rdsamp’. ...

6 years ago | 0

Answered
Get all graphs from ODE23
Try this approach: function f=dfunc2(t,x); m=450; c=1000; k=26519.2; f=zeros(2,1); f(1)=x(2); f(2)=(-c/m)*x(2)-(k/m)*x(1...

6 years ago | 1

| accepted

Answered
How to plot average (line) from multiple graph?
I cannot follow your code, and I do not have your data. See if the approach in: Average of Wave from 10 waves in single grap...

6 years ago | 1

| accepted

Answered
How can fit my data by multiple damping cosine functions?
This is as close as I can get to a decent fit: D = load('data_fft_peak6.mat'); t = D.data_fft_peak(:,1); s = D.data_fft_pe...

6 years ago | 0

| accepted

Answered
Error in my ode45 equation.
The most significant problem is that you need to define the functions as anonymous functions: K1 = @(T) 50*exp((8000/8.314)*((...

6 years ago | 0

Answered
How to design a FIR filter with two pass bands
Try this: Fs = 500; % Sampling Frequency fcomb = [19 19...

6 years ago | 0

Answered
Deferential equation in Matlab
It depends on what you want to do, and what the left-hand side actually is. Is the function ‘rT’ or ‘T( r )’? In the Symboli...

6 years ago | 0

Answered
Why I can't plot this one?
The ‘eq1’ expression is not written correctly with respect to its being a function off one variable. Try this: xss=0.01; o...

6 years ago | 1

| accepted

Answered
Too many output arguments
Without knowing what ‘dataset’ is, although assuming that it is an array with 2 columns, try this: Input = dataset(:,1); Targ...

6 years ago | 0

| accepted

Answered
Powerbw detecting large spikes around 0Hz
The 0 Hz value is just the mean of the signal. Subtract the mean of the signal from the entire signal to produce a 0 Hz value...

6 years ago | 0

| accepted

Answered
How can I plot these 3 ode45 functions in 1 graph?
The lines are not easily distinguishable. Try this: X0=2; Sin=1000; So=0; S0=So+Sin; Ks=150; Y=0.5; XS0=[2, 1000]; ...

6 years ago | 0

| accepted

Answered
Plot integral of a function
The problem appears to be that ‘rho’ itself does not exist. I have no idea what you want ‘rho’ to be, however defining it as:...

6 years ago | 1

| accepted

Answered
phase difference between two sines with wt and 2wt frequencies
I usually let the Symbolic Math Toolbox do the ‘heavy lifting’ in situations like these (particularly because it doesn’t make th...

6 years ago | 0

| accepted

Answered
Stem plot so that markers are not in the axis
Add this line after the stem call: xlim([min(xlim-1) max(xlim+1)]) . EDIT — (25 Dec 2020 at 22:40) This (or some variant of...

6 years ago | 0

| accepted

Answered
Probability and statistics question
See my Answer to: probability and statistics in matlab This appears to be the same homework assignment, although I did not or...

6 years ago | 0

Answered
Can I create a sample input file for simplicity?
One option is to comment-out all the lines that request inputs and instead use a deal function assignment that assigns all the v...

6 years ago | 0

Answered
Finding Global minimum of a function by using Powell's Method
According to the Wikipedia article, Powell’s method is a derivative-free approach to finding the local miniimum of a function. ...

6 years ago | 0

Load more