Question

Fitting a specific linear function to data

I have some data to which I want to fit the following function: c1 * X + c2 * Y I know the values for X and Y, can you give ...

10 days ago | 1 answer | 0

Question

What is the most suitable way to plot how changes in two variables affect another variable?

I have three variables: X, Y and Z. I want to scale X and Y to see what effect this has on Z. Specifically, I would like the...

12 days ago | 1 answer | 0

Question

How can I find when a signal stops oscillating more than a certain value?

I have one vector for time and one vector for voltage. I need to find out at what ms in time the voltage (as in the image I atta...

2 months ago | 1 answer | 0

Question

Can't exit a for loop correctly

I'm trying to find the baseline before a peak. So I wrote this for loop, which defines an index that starts from the index of th...

2 months ago | 1 answer | 0

Question

Algorithm that identifies the number of time steps in which a matrix has certain values?

I have a 4001x1 matrix ODv (attached) and its 1x4001 timespan vector. As you can see in the attached image, every x milliseconds...

2 months ago | 2 answers | 0

Question

Plotting negative values on an histogram

I am plotting some values on an histogram. figure histogram('Categories',Categories,'BinCounts',[-72 -63 -54 -56],'BarWidth',...

2 months ago | 2 answers | 0

Question

I can't plot this 3D matrix despite looking at other examples

I have attached the data I have here. Despite looking at other examples, I can't plot the 4x4x4 3D matrix peak_psp. It contains...

2 months ago | 1 answer | 0

Question

Problem with time span when integrating with ODE45

I am using ODE45 to integrate a system of differential equations and show their dynamics across 150ms. I am struggling with bein...

3 months ago | 1 answer | 0

Question

How to generate a square wave with integer values and fixed timespan?

I want to generate a square wave with integer values between 0 and 5 in a timespan of 30ms. An example: [1 1 1 1 2 2 2 4 4 ...

3 months ago | 1 answer | 0

Question

How do I check if all numbers in a vector are the same?

I have a row vector A. I'd like to verify whether all numbers in this vector are the same. How can I do this? Thanks!

3 months ago | 1 answer | 1

Question

"Solve" for optimization problem does not store linear parameters

I am fitting a function to some data I simulated. I managed to get intelligent constraints that help the fit quite a bit, even w...

3 months ago | 1 answer | 0

Question

Nonlinear fitting: how do I split the linear and the nonlinear problems?

I am fitting a function to some data I simulated. I managed to get intelligent constraints that help the fit quite a bit, even w...

3 months ago | 1 answer | 0

Question

How to use interpolation instead of integrating in chunks with ODE45?

I have written this code to integrate voltage V and gating conductances m, n and h in 30ms with injection of current from ms 10 ...

3 months ago | 1 answer | 0

Question

Fitting nonlinear noisy data

I am fitting a function to some simulated data. The procedure works perfectly, but I would like to know if it can be made more r...

3 months ago | 3 answers | 0

Question

Nonlinear fitting - No output function with MultiStart

I'm fitting a function to some nonlinear data. However, the output that I get is: MultiStart with properties: Us...

3 months ago | 1 answer | 0

Question

Fitting procedure using MultiStart - doesn't recognize objective function

I'm trying to fit a function to some data using MultiStart in order to find more reliably the global minimum. This is the code:...

3 months ago | 2 answers | 0

Question

Nonlinear fitting depends too heavily on starting points

Hi everyone, I have a fitting procedure that fits a function to a current, generated this way: function [EPSC, IPSC, CPSC, t]...

3 months ago | 1 answer | 0

Question

ODE45 and a variable that assumes multiple values during the timespan

I have tried in different ways to see what happens to voltage V and gating conductances m, n and h when, at time step x, current...

4 months ago | 1 answer | 0

Question

When using ODE45, can I specify a variable to assume two different values during the timespan?

I have tried in different ways to see what happens to voltage V and gating conductances m, n and h when, at time step x, current...

4 months ago | 2 answers | 0

Question

Problem using ODE45 - current not recognized

I am using this function: %Constants set Cm=0.01; % Membrane Capcitance dt=0.01; % Time Step ms t=0:dt:25; %Time Array ms ...

4 months ago | 1 answer | 0

Question

Using "fit" function to create a fit type and fit a curve with a function I created

Hello everyone, I defined a function function [CPSC] = generate_current(a,b,c,d,e,f,g,h,G_max_chl, G_max_glu, EGlu, EChl, ... ...

4 months ago | 2 answers | 0

Question

Nonlinear fit instead of setting up a non linear equation?

Hello everyone, I'll attach my script here, in case you want to run the simulation yourself. My task is to find two values x...

4 months ago | 1 answer | 0

Question

How do I change position of titles and subtitles of subplots?

I attached a screenshot of my plot. I would like to put on the left (instead of above) the titles (Currents at -70mv, -50, -30...

4 months ago | 2 answers | 0

Question

Matrix Optimization using optimization toolbox - "Objective must be a scalar OptimizationExpression or a struct containing a scalar OptimizationExpression."

Hello everyone, My task is to find x and y so that if I multiply them by G_max_chl2 and G_max_glu2 (two scalar values that I pr...

4 months ago | 1 answer | 1

Question

Can I get rid of this for loop with vectorization?

Hello, In this task I'm trying to generate six matrices (m_plot_I, h_plot_I, m_plot_E, h_plot_E, Ge and Gi). The for loop is ve...

4 months ago | 1 answer | 0

Question

How do I ask with specific sentences that the user insert certain inputs?

I have a function called EI2 and these input values: VmGlu VmChl G_max_chl G_max_glu EChl EGlu tau_rise tau_decay tm...

5 months ago | 1 answer | 0

Question

Preallocation of a matrix: how to shrink it afterwards?

I'm trying to create an empty epoch for every epoch number in epochn - epochn is a nx1 matrix. How can I preallocate fullstate e...

1 year ago | 1 answer | 0

Question

How to read only some columns of a text file?

I'd like to read out only columns from 3 to 7. However, this is not working. Can you help? Thanks! %Get events from text file ...

1 year ago | 1 answer | 0

Question

Error constructing shaded error bar

This is what I'm trying to do. X is a vector that goes from 1 to 5121; y is a nx5121 vector (where n varies between 1 and some o...

1 year ago | 1 answer | 0

Question

Inserting matrices in a cell - in a for loop

I have to create eleven matrices with fiber photometry data coupled with occurrence of eleven stimuli, to understand how each of...

1 year ago | 1 answer | 0