Answered
Bandpass Filter BPFILT-Does this function still exist?
I can’t find it in the online documentation. If you have R21018a or later, use the bandpass (link) function. It’s easy to de...

7 years ago | 0

| accepted

Answered
Time Sampling in MATLAB
If you have a figure (.fig) file of your plot and you want to know how to get the data from it, see: How do I extract data from...

7 years ago | 0

Answered
Need a code to print this in command Window
Keep track of the span of indices you want to print, and the current start index. Those are given as: s = 0; c = 1; for k...

7 years ago | 0

Answered
Gamfit function not working
That code runs for me without error. Is there a problem? EDIT — The confidence intervals are for the parameters.

7 years ago | 0

Answered
Is 2019a a complete install or an update?
To the best of my knowledge, it’s a complete install, with its own directories. Note that one update to it has recently been ...

7 years ago | 0

Answered
Change numbers from .tex file into dateitme format
My version of MATLAB cannot import images of data. For the first one, this works: d = datetime('030419091720', 'InputFormat...

7 years ago | 1

| accepted

Answered
What time step is assumed in the function lyapunovExponent?
From the documentation: lyapExp = lyapunovExponent(X,fs) estimates the Lyapunov exponent of the uniformly sampled time-domai...

7 years ago | 0

| accepted

Answered
Solving system of second order differential equations with ode45
I prefer to let the Symbolic MAth Toolbox do the ‘heavy lifting’: syms theta1(t) theta2(t) t Y % theta1'' = -29.4sin(theta1)...

7 years ago | 1

| accepted

Answered
Linspace is changing my function values
The linspace function by default produces a vector of 100 elements, so it increments the elements proportionately. The elemen...

7 years ago | 1

| accepted

Answered
Using nlinfit to fit more than two list
If I understand your objective function correctly, you have the arguments reversed. The parameter vector (that I assume is ‘bet...

7 years ago | 1

Answered
different number of elements
I have absolutely no idea what you are doing, however one thing is obvious: the array index in ‘eigen_face('x') = ...’ should no...

7 years ago | 0

Answered
Multipling a multidimensinnal array with a vector
If you want the mean of each row, specify the dimension argument as 2: weighted_mean = mean(B.*A, 2); That should do what you...

7 years ago | 0

| accepted

Answered
Trying to graph two ode45 functions on a single plot
For the first integration, save the outputs as: [t{1},P{1}] = ode45(twoelemmodel,Timespan,InCond); and the second as: [t{2}...

7 years ago | 0

| accepted

Answered
Plotting Reaction Spectra over Time
Try this: D = load('3D Spectra Plot.mat'); F = fieldnames(D.Specdata.spectra); C = squeeze(struct2cell(D.Specdata.spectra));...

7 years ago | 0

| accepted

Answered
How Can I Plot Matrix each graph individual
If you want to plot them all in one set of axes, try this: s = 800*(rand(672528,25)-0.5); % Create Matrix...

7 years ago | 0

Answered
PLOT log scale in y cordinate
Try this (using the fplot function): syms W Xss = -3751474221736597/(2621440*(17179869184*W^2 - 336973579165665)); figure f...

7 years ago | 0

Answered
Error unexpected MATLAB expression with min()
You’re missing a comma. Try this: pc = min(pa, pb);

7 years ago | 1

| accepted

Answered
While loop inside for loop
You posted an image of your code rather than the code itself, so I can’t copy it and run it. One option would be to add these...

7 years ago | 0

Answered
How to show mat file to struct ?
If you load the .mat file to a variable, it will automatically be a structure: Data = load('yourMatFile.mat'); You can then a...

7 years ago | 0

| accepted

Answered
How to change the way matlab choose to plot given vectors?
Sort ‘dc_voltages’: [~,idx] = sort(dc_voltages); % Sorts Ascending By Default figure pl...

7 years ago | 1

Answered
How do I repeat different numbers in a row?
the repelem (link) function (R2015a and later versions) is likely the easiest way to do what you want. A = repelem([15 4 5 12...

7 years ago | 1

| accepted

Answered
How to store multiple itteration of a function
You’r close. The ‘s’ and ‘T’ outputs ar row vectors, and ‘H’ is a column vector, so you have to address them as such. This...

7 years ago | 0

Answered
select first 15 from ans
It appears that you are calling the function without an output assignment. Call it as: v = theFunction(x); then: v = v(1...

7 years ago | 1

| accepted

Answered
Using ALS algorithm for writing a code
See page 5 of Baseline Correction with Asymmetric Least Squares Smoothing (link). I’ve not run this, so I have no experience ...

7 years ago | 2

Answered
What's wrong with textscan syntax?
Try an alternate format descriptor: fd = ['%q' repmat('%f', 1, 28)]; RawData = textscan(fid, fd, 'HeaderLines',1, 'Delimiter'...

7 years ago | 0

| accepted

Answered
How does MATLAB 'fill in' elements when subsetting a matrix by vectors?
Because A(end,end) = 9. EDIT — This is a bit more obvious analyzing how MATLAB indexes matrices. The linear index for ...

7 years ago | 1

| accepted

Answered
How to have several inputs for a single parameter for a function
In your function, use ‘Pc’ as a vector. A vector of quantities can have as many as you want. Then, in your function, determine...

7 years ago | 1

Answered
question about 'view' function
There are a number of options available. One that may do what you want is the 'CameraPosition' (link) axes property. There are...

7 years ago | 0

| accepted

Answered
What does "a3.XTick" do to plot the cross-correlation on MATLAB ?
This assignment: a3.XTick = sort([-3000:1000:3000 lagDiff]); sets the 'XTick' values of the current axes (denoted here by ‘a3...

7 years ago | 0

| accepted

Answered
Plotting graphs for scientific journals
Yair Altman’s export_fig (link) is highly regarded.

7 years ago | 0

| accepted

Load more