Answered
Cell to mat conversion
If you want to extract the content of one cell simply do: b = a{1}; If you want to merge a couple of cells into an array or ma...

5 years ago | 0

| accepted

Answered
interp2 error non monotonus
It should (big claim, I know) be as simple as: torque = data(2:end,1); rpm = data(1,2:end); eff_epk = data(2:end,2:end); Nm ...

5 years ago | 2

| accepted

Answered
How to make subplots scroll at the same time?
See the help and documentation for linkaxes (and possibly linkprop). I'd do something like this: %Create subplot sph1 = subplo...

5 years ago | 0

| accepted

Answered
how to vectorise or speed up the specific code
Newton says you can cut it in two if you take into account that the force from particle i on particle j is equal but directed in...

5 years ago | 2

Answered
Why `sparse` function accumulate large sparse COO format matrix by index so fast?
Because sparse is a built-in function that Mathworks most likely have spent many man-months (we wouldn't know) on optimizing. Yo...

5 years ago | 0

Answered
How to create null vector Matlab
First off if you've done something like: N = 12; M = 14; K = 7; Mtr = randn(M,N); V = rand(1,K); V=zeros(1,length(N)-lengt...

5 years ago | 0

| accepted

Answered
i need to save images with different file names in seperate folders
You can do this, as Jan hinted at, something like this: faces = 1:6 face_names = {'top','bottom','front','back','left','right'...

5 years ago | 1

Answered
how to make a covarinace matrix using data from excel?
Just use cov. From the help of the cov-function: cov Covariance matrix. cov(X), if X is a vector, returns the variance. F...

5 years ago | 0

Answered
How to make ticks labels (the numbers, not the axis labels.) bold when using latex interpreter.
This seems to work in general: set(gca,'fontweigth','bold') HTH

5 years ago | 1

Answered
Average intensity as a function of angle in 2D FFT plot
This is kind-of-difficult in practice. Your fft has low-wavenumber components at [0,0], [1,0], [-1, 0], [0,1], [0,-1] and if we ...

5 years ago | 1

Answered
for loop with vectors having different sizes
To fool-proof your concatenation, and to generate better directory-names you could do something like this: a = [1 2]; b = [3 4...

5 years ago | 0

Answered
Instantaneous Velocity from Displacement and Time values
There are busloads of things you could try: interpolate to a denser time-grid (using 'phcip' or 'spline' for interpolation metho...

5 years ago | 0

Answered
How to specify correct fontsize of text according to plot boundary coordinates
This is the best I can think of: th = text(-10.05,0.94,'Hello WORLD!'); % Some text-coordinate in a figure of mine txt_size = ...

5 years ago | 0

| accepted

Answered
Airy equation with ode solver
That is just a scaling-factor off. (in addition to some numerical issues around the zero-crossings.) This comes about because of...

5 years ago | 1

| accepted

Answered
Warning: Solution does not exist because the system is inconsistent.
Have a look at the equations. If you rewrite them you will get: Bw1 = ( b1 + b2 ) * 2*cos(2*w1) + b3 == 0; Bw2 = ( b1 + b2 ) *...

5 years ago | 1

| accepted

Answered
Drawing a Tangent to a Spline
When you calculate the gradient: m = gradient(yq, xq); Then your m will have the same dimension as your xq and yq arrays. So w...

5 years ago | 0

Answered
MOUSE DOUBLE CLICK PROBLEM
Once I wrote an image-processing tool where I wanted to use all 4 mouse-button events - but it seemed as if the double-click eve...

5 years ago | 0

Answered
How do I create a 3D response surface plot(Contour Plot) from X Y Z C points ?
That plot looks like it would be reproducible with scatter3. So have a look at the help and documentation of that function. One ...

5 years ago | 0

Answered
Convolving 2D image with 1D filter
That works for imagesc of doubles: I2 = peaks(123); h = [0 0 0 1]; imagesc(I2) pause(0.5) imagesc(conv2(I2,h,'same')) Did ...

5 years ago | 0

Answered
ODE15s Events function not working when switching between different ODE systems
It might be that it is only in event3 that you check for the CO2 concentration. You could also check if you change to the exact ...

5 years ago | 0

| accepted

Answered
How to get surface data from spectrogram?
You have to learn to read the help and documentation of the functions used. If you try: help spectrogram This is what will be ...

5 years ago | 0

| accepted

Answered
Problem using ODE15s
You have an error in your continuity-equation, you have forgotten the loss of H2CO3 due to the first backwards reaction H2CO3 ->...

5 years ago | 0

| accepted

Answered
Vicious Circle Problem: How to solve ODEs with variables that are based on the solutions of the ODEs?
Perhaps something like this: odeFCN = @(t,S,L,R) [S(2); L*S(1)+R*(S(1)-S(3)); S(4); ...

5 years ago | 0

| accepted

Answered
Vicious Circle Problem: How to solve ODEs with variables that are based on the solutions of the ODEs?
You might run the ODE-integration backwards, that would give you a problem where you could determine your unknown parameters fro...

5 years ago | 0

Answered
How to calculate the pdf (probability distribution function) of a data having dimension 25x31x122?
One way to do it is using the histogram-function, see the help and documentation. Something like this: histogram(rainfall(:),mi...

5 years ago | 1

| accepted

Answered
Don't know what is wrong with this double integral code
Use integral2 instead. That should solve this type of problem. HTH

5 years ago | 0

Answered
run a program multiple times and save result
Sometimes I solve this problem this way: if ~exist('run_idx.mat',2) run_idx = 1; save run_idx.mat; else load('run_idx...

5 years ago | 0

| accepted

Answered
How to reduce brightness of ceratin pixels from an Image?
Is this the operation that you're asking for? too_bright = 123; % or your chosen level replacement_level = 123; % Not a good i...

5 years ago | 1

| accepted

Answered
Gaussian fit to FFT Peak
Sure, you can do something like this: fcn_G2D = @(p,x,y) p(1)*exp(-(x-p(2)).^2/p(4)-(y-p(3)).^2/p(5)); err_fcn = @(p,x,y,I,fcn...

5 years ago | 0

| accepted

Load more