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

casi 5 años hace | 0

| aceptada

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

casi 5 años hace | 2

| aceptada

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

casi 5 años hace | 0

| aceptada

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

casi 5 años hace | 2

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

casi 5 años hace | 0

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

casi 5 años hace | 0

| aceptada

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

casi 5 años hace | 1

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

casi 5 años hace | 0

Respondida
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

casi 5 años hace | 1

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

casi 5 años hace | 1

Respondida
How to substitute p(x/a+x1,y/a+x2) to p(x,y),where p(x,y) is original image, x1 and x2 are the centroid of p(x,y),x1=m10/m00,x2=m01/m00,a=sqrt(β/m00),β is a predetermined value. In fact, this is doing scale and translation normalization
You solve that with interp2: xi = xC + [-dx:dx]*xScale; yi = yC + [-dy:dy]*yScale; [xi,yi] = meshgrid(xi,yi); p_prime = inte...

casi 5 años hace | 0

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

alrededor de 5 años hace | 0

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

alrededor de 5 años hace | 0

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

alrededor de 5 años hace | 0

| aceptada

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

alrededor de 5 años hace | 1

| aceptada

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

alrededor de 5 años hace | 1

| aceptada

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

alrededor de 5 años hace | 0

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

alrededor de 5 años hace | 0

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

alrededor de 5 años hace | 0

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

alrededor de 5 años hace | 0

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

alrededor de 5 años hace | 0

| aceptada

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

alrededor de 5 años hace | 0

| aceptada

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

alrededor de 5 años hace | 0

| aceptada

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

alrededor de 5 años hace | 0

| aceptada

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

alrededor de 5 años hace | 0

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

alrededor de 5 años hace | 1

| aceptada

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

alrededor de 5 años hace | 0

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

alrededor de 5 años hace | 0

| aceptada

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

alrededor de 5 años hace | 1

| aceptada

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

alrededor de 5 años hace | 0

| aceptada

Cargar más