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...

12日 前 | 0

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,:) =...

12日 前 | 0

| 採用済み

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 ...

12日 前 | 0

| 採用済み

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...

12日 前 | 1

| 採用済み

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

12日 前 | 0

| 採用済み

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) ...

12日 前 | 0

| 採用済み

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...

13日 前 | 0

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...

13日 前 | 0

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...

13日 前 | 0

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)); ...

13日 前 | 0

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,:)); ...

13日 前 | 1

| 採用済み

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...

13日 前 | 0

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...

13日 前 | 0

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

13日 前 | 0

| 採用済み

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...

13日 前 | 0

| 採用済み

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; ...

14日 前 | 1

| 採用済み

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

14日 前 | 1

| 採用済み

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

14日 前 | 0

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 ...

14日 前 | 0

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 [~...

14日 前 | 1

| 採用済み

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

14日 前 | 0

| 採用済み

make my curve smooth
This is as close as I can get to what you want: filename = 'All Data_10mm.xlsx'; sheet = '10 mm_1hz_0V_Test1'; % add she...

15日 前 | 0

| 採用済み

Compare 2 arrays with find()
The ismember function may do what you want: x = 1:1:3; Points = [1 3 2 1 1 3 4]; [~,Out] = ismember(Points, x) producing:...

15日 前 | 1

| 採用済み

How can I plot multiples lines with differents radius scales in the same figure?
The polar and polarplot functions do not allow logarithmic radial axis scaling (taking the log of the radius will be impossible ...

15日 前 | 0

How to plot multiple surfaces on different planes in the same plot?
One way would be to offset them by a constant: [X,Y] = meshgrid(-2:0.1:2); Z1 = X.^2 + Y.^2; Z2 = X.^2 - Y.^2; Z3 = cos(2...

15日 前 | 0

| 採用済み

Problem with a model
Most likely, you have a period (.) where you probably intend to put a coma (,).

15日 前 | 0

How to find the slope of the curve at x=0 and y=0
Since you did not share your data, I created my own. This should get you started: x = linspace(-0.5, 1.5); ...

16日 前 | 1

Input coordinates cannot be complex.
If you can read the entire file with readtable and you simply want the data in the table, consider using the table2array functio...

17日 前 | 1

| 採用済み

I am having problem with the code written below. It is a code for finding stored strain in a polymer. Some of the errors that are coming are index exceeds matrix dimension, matrix dimensions must agree, etc. Kindly help me out.
Try this: syms epre et es(T); %stored strain Tl = 273; Th = 358; Tg = 343; Ei = 813E6; %modulus corresponding to the inter...

17日 前 | 0

| 採用済み

Mesh/Surf plot of function with if statements
Try this: Z1 = (2*sqrt(100*X.^2+75*Y.^2)).*((4*X.^2+3*Y.^2)<=225); Z2 = (75+4/3*X.^2+Y.^2).*((4*X.^2+3*Y.^2)>225); Z = Z1 + ...

17日 前 | 0

| 採用済み