Frage


Shifting an array without circshift
I want to shift an array and whilst circshift generally works, I encounter errors with certain configs. Is there a way to shift ...

mehr als ein Jahr vor | 2 Antworten | 0

2

Antworten

Frage


Determining the amplitude of peaks on a slowly changing signal?
So as we all know, findpeaks will return the value of a peak using, e.g., [pks locs] = findpeaks(data, x); My question is, ho...

mehr als ein Jahr vor | 1 Antwort | 0

1

Antwort

Frage


Positioning Axes using arrays
I have this simple code % create smaller axes in top right, and plot on it axes('Position', [.32 .22 .25 .15]) box on plot(...

mehr als ein Jahr vor | 2 Antworten | 0

2

Antworten

Frage


Optimising my data importer for large datasets
So I have this txtFiles = dir('*.txt') ; %loads txt files N = length(txtFiles) ; Numit = N; [~, reindex] = sort( str2dou...

mehr als ein Jahr vor | 1 Antwort | 0

1

Antwort

Frage


3 subplots with the bottom one split in 2 vertically?
I want to produce a figure with 3 stacked plots where the bottom one is split in half vertically, how might I do this? TIA

mehr als ein Jahr vor | 3 Antworten | 0

3

Antworten

Frage


How to set default axes tick using groot?
I tried to set axis tick using set(groot,'XMinorTick','on','YMinorTick','on') But it gives an error. any idea how to fix?

mehr als ein Jahr vor | 1 Antwort | 0

1

Antwort

Frage


Finding peaks greater than a set value
I'm using for h2 = 1:size(udata,1); [pks,locs] = findpeaks(udata(h2, :), x); pksc{h2,:} = pks; ...

fast 2 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


How can I rewrite this to get peak locations?
I have this amps = arrayfun(@(h2) max((findpeaks(udata(h2, :), x) < 0.99)... .* findpeaks(udata(h2, :), x)), 1:size(udata...

fast 2 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


Finding peaks with a set amplitude range?
I'm findint the peaks in a signal wich have an amplitude between 0.2 and 1. Trouble is when I call findpeaks via [pks,locs] ...

fast 2 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


Detecting peaks with a specified range of amplitudes?
Say i have a signal with range betwene [-3, 3] and I want to locate peaks within an amplitude range of say [0, 1], how might I d...

fast 2 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Converting an array slicer to Python
I have this code in MATLAB (attached below) and wondered how I'd go about converting it to Python seeing as it keeps giving me a...

fast 2 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


How to merge and slice arrays of different sizes?
Say I have one aray called `ydata` which has dimension 1x24000 and I want to slice a part of this array, say from index 2:3000 a...

fast 2 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


Function which creates a vertical line (Heaviside or something) which has a double gap in it
I want to create a function which produces something like this where we have a vertical line which has a gap in it. https://i....

fast 2 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Does MATLAB have inverse tangent integral TI2(z)?
In Mathematica, one calls the function using : (PolyLog[2, I z] - PolyLog[2, -I z])/(2 I) How dl I implement this in matlab, ...

etwa 2 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


How to store variable name AND value in an array?
Suppose I have some code which produces the following outputs: density = 456 pressure = 356 temperature = 66 How can I sto...

etwa 2 Jahre vor | 2 Antworten | 0

2

Antworten

Frage


How to stop seperate axes plotting over the top of one anotner?
I have some code which plots on the same figure a smaller set of axes to zoom in on a specific area of the plot. This works grea...

mehr als 2 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Findpeaks with multiple columns
So I have an array which is sized at 2000 x 100, called bdata. I want to use findpeaks to determine the peaks in every column of...

fast 3 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


extracting columns from arrays within a cell
I have a cell consisting of 8 2x1 arrays and I want to extract the second column from them all. Usually, i'd use k = cell2mat(...

fast 3 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


For loop to read in sequentially named .txt files
I have a batch of txt files named "0, 2, 4, 6, 8".txt and wondered if there was a way for me to read them all in as one batch us...

fast 3 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


How to assign a list of variables to an array efficiently
I have a list of variables: a = 1; b = 4; c = 7; d = 8; e = 9; And want to convert them into an array. It doesn't seem ...

fast 3 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


poly1 gives error "insufficient data"
I'm using poly11 to fit some data and keep getting this error Error using fit>iFit (line 269) Insufficient data. You need a...

etwa 3 Jahre vor | 0 Antworten | 0

0

Antworten

Frage


Using a loop to impose specific values
Let's say I have a range of x going from -200 to + 200 and I want to force a function to take different initial conditions in th...

etwa 3 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


How to specify a row and column in an array
So I have a 5x80 array and want to write a section of code which subtracts row 1, column 1 from row 2 column 1. How might I do t...

mehr als 3 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Fitting a plot with interpolation
I need to interpolate some data involving a logarithm using the fit function but I'm not sure how to interpolate in matlab. Gene...

mehr als 3 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Using Taylor Expansions: how to impose 'large' approximations, i.e., "for large x"?
Say I have a function: and I want to see what happens in the region of large x, i.e., I Taylor expad f(x) in the region of...

mehr als 3 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


translating commands from python
So I'm trying to translate the following code from Python: def chabrier03individual(m): k = 0.158 * exp(-(-log(0.08))**2/(2 ...

fast 5 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Why does my <= statement not work?
I'm running a simple loop that applies a less than or equal to inequality to a value. Unfortunately, it is overlooking this valu...

fast 5 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Plotting the stellar IMF and setting for loop conditions
Hi all, I'm trying to plot the stellar IMF using MATLAB and want to transfer the following Pyhon code: m = logspace(-2, 2, 400...

fast 5 Jahre vor | 0 Antworten | 0

0

Antworten

Frage


My quiver plot seems to go flat when I am plotting a coupled ode.
So the ODE system reads: and my code reads: [x, y]=meshgrid(-2:0.6:4) dx = 3*(x-1)*y; dy = 2-x-y^2; quiver(x, y, dx, dy...

fast 5 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


Getting a for loop to save a plot every step
Good evening, I'll keep this brief but I'm looking to see how I can write a for loop which takes a range of constants, appli...

fast 5 Jahre vor | 1 Antwort | 0

1

Antwort

Mehr laden