Answered
How do I put gridlines on the bottom layer and axes on the top layer?
Perhaps overplotting the left and right axes (and the tick lines if you want the tick lines) will do what you want: x = linspa...

7 years ago | 0

| accepted

Answered
How to reduce the sample rate of a over sampled signal? (How to connect data to lines and sample?)
Working with your Excel file was something of an adventure! I assume ‘n’ are nanoseconds and ‘u’ are microseconds. The plot ...

7 years ago | 1

| accepted

Answered
Display maximal value in a range?
I do not see any max function calls, so I am not certain what result you want. Displying only the values for ‘tv’ between 7 a...

7 years ago | 1

| accepted

Answered
Plot 2d function not working
Your code works correctly for me, and produces: after adding the axes labels: plot(t,sunangle) xlabel('t') ylabel('Sun A...

7 years ago | 0

| accepted

Answered
Step change for ODE
Try this: function ivp % Inputs tval=0:0.01:20; Tc = [290; 300; 305; 310]; % Differential Equation Ca0=0.5; T0=350; Tc0 =...

7 years ago | 4

| accepted

Answered
Create pie chart in if loop
I am not certain what you want, however the loop is likely not necessary. Try this: x = File.data(8, 2:48); figure pie(...

7 years ago | 0

Answered
interp1 - problem with query points
You have encountered ‘floating-point approximation error’. If you subtract ‘delta(1)’ from ‘x’: Check = x-delta(1) the resul...

7 years ago | 2

| accepted

Answered
I Want to find stable output of transfer function using oid but the comment is '??? Undefined function or variable 'pid'.'
The pid function is part of the Control System Toolbox. It was introduced in R2010b.

7 years ago | 0

Answered
How can i design a correct lowpass filter with the Filter Design Assistant?
It is actually straightforward to design your filter using the various functions: Fs = 1000; ...

7 years ago | 1

Answered
ODE solving ERROR with 5 eq
The error was with: [TpSol(z), CSol(z), TSol(z), OmSol(z), phiSol(z)] = dsolve(odes,conds) since MATLAB assumed that ‘TpSol(z...

7 years ago | 0

Answered
Produce a new matrix,Z from X and Y matrices
One option: for k = 1:size(Y,1) [~,Zc] = find(Y(k,:) ~= 0, 1, 'last'); % Last Non-Zero Column Z2(k,:) =...

7 years ago | 0

| accepted

Answered
Surf plot for three independent matrices of 1x360
You have one matrix of three (1x360) row vectors. If your data are gridded, simply use the reshape function on each row vector ...

7 years ago | 0

| accepted

Answered
How to Solve sets of equations with constants
The derivatives are uniformly 0, so the equations are constant, by definition. There is no reason to integrate them. Try thi...

7 years ago | 4

| accepted

Answered
Area under the curve with conditions?
Try this: t = 1:48; % Time Vector load = randi(1000, 1, 48); ...

7 years ago | 0

| accepted

Answered
how can I shift a discrete signal (in vector form) on the x axis?
Add or subtract from the ‘x’ values: x = 1:11; y = 10:-1:0; figure subplot(3,1,1) stem(x, y) ...

7 years ago | 0

| accepted

Answered
How to perform piece-wise linear regression to determine break point?
Here, it is easiest to detect the break point first, then do the regression. (This is a simple example of a much more complicat...

7 years ago | 1

Answered
How to calculate FWHM from a curve
One approach is first to isolate the appropriate ‘Range’ value for your peaks of interest (so you have a vector that spans all v...

7 years ago | 1

Answered
The length of 256x256 image
256 There are severall ways of determining the various dimensions of an array in MATLAB, the size function being the most usefu...

7 years ago | 0

Answered
How to do exponential curve fitting in the form of y=a*exp(-b*x)+ a constant
Note that ‘x’ and ‘y’ are not the same lengths, so this adjusts ‘y’ to correct for that: yt = y(1:numel(x)); ...

7 years ago | 0

Answered
findpeaks in a for loop
Since ‘DT’ appears to be two concatenated row vectors, add this line just after ‘DT’: [pks{i},locs{i}] = findpeaks(DT(i,:)); ...

7 years ago | 1

| accepted

Answered
Matrix Dimensions don't agree, importing data from excel
‘I am having difficulty with the dimensions of a and b not agreeing with Cpl and Cpu, which is preventing me from calculating fu...

7 years ago | 0

Answered
Using ODE for spiking neural networks
See The Hodgkin-Huxley Model - McGill University paper for a clear description of the various ways to solve such problems, compl...

7 years ago | 0

Answered
Problem in applying loop
You have the Signal Processing Toolbox, so see if the buffer function will do what you want.

7 years ago | 0

| accepted

Answered
problem with fsolve optimization error message
There is actually no error or any other problem. The fsolve function is a root-finder, meaning of course that it search for val...

7 years ago | 0

| accepted

Answered
converting a filter using c2d and the input vector resolution
I would choose a Nyquist frequency comfortably above your highest passband frequency, so here arbitrarily: Fn = 3E+9; ...

7 years ago | 1

| accepted

Answered
FOR Loop _ Sum columns in Excel
Try this: [D,S] = xlsread('BPAQ.xlsx'); BPAQ = D(:,5:33); BPAQ(isnan(BPAQ)) = 0; % Set ‘NaN’ Va...

7 years ago | 1

| accepted

Answered
datetick gives me errors
From the datetick documentation: ‘The axis data values should be serial date numbers, as returned by the datenum function...

7 years ago | 0

Answered
Summing squared elements of a column of a matrix
It’s not clear what you want to do. Try this: V = rand(6,5); % Guess What ‘V’ Is ...

7 years ago | 0

Answered
Error: Index in position 1 exceeds array bounds.
Try this: [~,NumDataS]=xlsread('Pluto_5.30.19_Propofol_vitals_004.xlsx','Sheet2','F607:G1947'); % Physiological Data [~...

7 years ago | 1

| accepted

Answered
Two curves on different r axis in polarplot
One option — Add these assignments: rlbl = sprintfc('%.0f',(0:2:6)); % Radius Labels text(one...

7 years ago | 1

| accepted

Load more