답변 있음

How to create multiple files with given one file name

I'd do something like this: fn = '/some/where/output.csv'; [pth,nmn,ext] = fileparts(fn); nnmn = fullfile(pth,[nmn,'_std',ext...

How to create multiple files with given one file name

I'd do something like this: fn = '/some/where/output.csv'; [pth,nmn,ext] = fileparts(fn); nnmn = fullfile(pth,[nmn,'_std',ext...

약 9시간 전 | 0

답변 있음

How to ensure that dsolve provides a trigonometric solution to a second order differential equation?

Since you have a linear ODE with a right-hand-side composed of harmonic terms you know that you can solve for the homogenous and...

How to ensure that dsolve provides a trigonometric solution to a second order differential equation?

Since you have a linear ODE with a right-hand-side composed of harmonic terms you know that you can solve for the homogenous and...

약 13시간 전 | 0

| 수락됨

답변 있음

Asymmetric spring with two different stiffnesses

Yeah, I think that should be the correct test. In the modeling you do you have rather big difference in spring constant. When I ...

Asymmetric spring with two different stiffnesses

Yeah, I think that should be the correct test. In the modeling you do you have rather big difference in spring constant. When I ...

2일 전 | 1

| 수락됨

답변 있음

Solving differential equation with parameters takes forever

If both x and theta varies with t you cannot solve one first and the other separately later, you should treat them as a system o...

Solving differential equation with parameters takes forever

If both x and theta varies with t you cannot solve one first and the other separately later, you should treat them as a system o...

3일 전 | 1

| 수락됨

답변 있음

Code initiates again after exiting while loop which is within an if statement

In your outer for-loop you use you use i as loop-index. The way matlab has implemented things this is done (IIRC) such that ther...

Code initiates again after exiting while loop which is within an if statement

In your outer for-loop you use you use i as loop-index. The way matlab has implemented things this is done (IIRC) such that ther...

3일 전 | 0

| 수락됨

답변 있음

Asymmetric spring with two different stiffnesses

ODE45 takes a function, f(t,y), describing the differential equation. You have a differential equation something like this w...

Asymmetric spring with two different stiffnesses

ODE45 takes a function, f(t,y), describing the differential equation. You have a differential equation something like this w...

4일 전 | 0

답변 있음

I was wondering if this code could be vectorized, and if so, can it be done without conditionals or loops? It would be great if the vectorized form could be written out so that I could run and follow

Sure, you could generate 2 coordinate matrices x and y with meshgrid: nPix = 66; [x,y] = meshgrid(1:nPix); Then you'll have t...

I was wondering if this code could be vectorized, and if so, can it be done without conditionals or loops? It would be great if the vectorized form could be written out so that I could run and follow

Sure, you could generate 2 coordinate matrices x and y with meshgrid: nPix = 66; [x,y] = meshgrid(1:nPix); Then you'll have t...

4일 전 | 2

답변 있음

Error: "SVD does not support sparse matrics. Use SVDS to compute a subset of the singular values and vectors of a sparse matrix." while training SOM.

It means that your SOM-training function somewhere uses (or tries to use) the svd function. That function expects a full matrix,...

Error: "SVD does not support sparse matrics. Use SVDS to compute a subset of the singular values and vectors of a sparse matrix." while training SOM.

It means that your SOM-training function somewhere uses (or tries to use) the svd function. That function expects a full matrix,...

5일 전 | 0

| 수락됨

답변 있음

Why do colors "gray out" when I save figure as .eps

Ah, from the way your figure looks, it seems the "error-shade" function you use uses alpha-blending - that is colour-patches tha...

Why do colors "gray out" when I save figure as .eps

Ah, from the way your figure looks, it seems the "error-shade" function you use uses alpha-blending - that is colour-patches tha...

7일 전 | 0

답변 있음

1-D Transient Heat Conduction With No Heat Generation [FDM] [Crank-Nicholson]

My suggestion is that you add a line: Tall(:,k) = Tb; at the end of your "time-step"-loop. Then after you're done with it all...

1-D Transient Heat Conduction With No Heat Generation [FDM] [Crank-Nicholson]

My suggestion is that you add a line: Tall(:,k) = Tb; at the end of your "time-step"-loop. Then after you're done with it all...

8일 전 | 1

답변 있음

Transposing matrices of a Dataset

Take a look at the help and documentation of the matlab-function permute. HTH

Transposing matrices of a Dataset

Take a look at the help and documentation of the matlab-function permute. HTH

8일 전 | 0

답변 있음

Inversion of block tridiagonal matrices

If you have a small enough problem which is not ill-conditioned just use \, if it is ill-conditioned but you can do an SVD of yo...

Inversion of block tridiagonal matrices

If you have a small enough problem which is not ill-conditioned just use \, if it is ill-conditioned but you can do an SVD of yo...

8일 전 | 0

| 수락됨

답변 있음

Matlab is installed in ubuntu but i am unable to open it

If you try to execute something like ./matlab from your terminal you tell the shell to run an executable command "matlab" in the...

Matlab is installed in ubuntu but i am unable to open it

If you try to execute something like ./matlab from your terminal you tell the shell to run an executable command "matlab" in the...

8일 전 | 1

답변 있음

How to find peaks of the given signal and find the phase shift with respect to the Oscillator 1 signal?

If you had regularly sampled data (it doesn't seem so) this would best be done with spectrogram. That would give you the spectro...

How to find peaks of the given signal and find the phase shift with respect to the Oscillator 1 signal?

If you had regularly sampled data (it doesn't seem so) this would best be done with spectrogram. That would give you the spectro...

12일 전 | 0

답변 있음

How to solve the reduced eigenvalue poblem

Have a look at the eig function. It solves for eigenvalues-eigenvectors - also for the generalized eigenvalue-problem you seem t...

How to solve the reduced eigenvalue poblem

Have a look at the eig function. It solves for eigenvalues-eigenvectors - also for the generalized eigenvalue-problem you seem t...

12일 전 | 0

답변 있음

Plot signal from fits file?

To read data in fits-format you can use fitsread and fitsinfo, but when I try that on an image from SETI-projects web-site I got...

Plot signal from fits file?

To read data in fits-format you can use fitsread and fitsinfo, but when I try that on an image from SETI-projects web-site I got...

13일 전 | 0

답변 있음

How to make a plot with x-axis that has different scales on different specific regions?

Either you can use something like set(gca,'xscale','log') if that brings you close enough. If you want to plot on some other ...

How to make a plot with x-axis that has different scales on different specific regions?

Either you can use something like set(gca,'xscale','log') if that brings you close enough. If you want to plot on some other ...

15일 전 | 1

| 수락됨

답변 있음

Avoid ''Dot indexing is not supported for variables of this type.'', exist(...) isn't working

If you want to check if a struct has a field your're interested in you should check with isfield, check the help and documentati...

Avoid ''Dot indexing is not supported for variables of this type.'', exist(...) isn't working

If you want to check if a struct has a field your're interested in you should check with isfield, check the help and documentati...

15일 전 | 0

답변 있음

editing the JET colormap

You should be able to do something like this: imagesc(peaks(123)) cx = caxis; n_colors = 128 cmp = jet(n_colors); colorbar ...

editing the JET colormap

You should be able to do something like this: imagesc(peaks(123)) cx = caxis; n_colors = 128 cmp = jet(n_colors); colorbar ...

15일 전 | 1

| 수락됨

답변 있음

How can I check that a newly generated sequence is already in the existing structure list or not?

For example this can be used: intersect([1 2 3;1 3 2;2 1 3;2 3 1;3 1 2],[3 2 1],'rows') % %ans = % % 0x3 empty double matr...

How can I check that a newly generated sequence is already in the existing structure list or not?

For example this can be used: intersect([1 2 3;1 3 2;2 1 3;2 3 1;3 1 2],[3 2 1],'rows') % %ans = % % 0x3 empty double matr...

16일 전 | 0

답변 있음

2d interpolation from a non-uniform grid

No you can use griddata and scatteredInterpolant. You can do something like this: Zi = griddata(X(:),Y(:),Z(:),Xi,Yi); And you...

2d interpolation from a non-uniform grid

No you can use griddata and scatteredInterpolant. You can do something like this: Zi = griddata(X(:),Y(:),Z(:),Xi,Yi); And you...

16일 전 | 0

| 수락됨

답변 있음

How could I use MATLAB to solve for x with this equation, 0=a*x^(3)+b*x^(-1)+c.

This works perfectly fine: f = @(x ) -58.8*(550) + 0.5*37*0.002377*x.^3.*(0.02+0.062*((2*960)./(0.002377*37*x.^2)).^2); plo...

How could I use MATLAB to solve for x with this equation, 0=a*x^(3)+b*x^(-1)+c.

This works perfectly fine: f = @(x ) -58.8*(550) + 0.5*37*0.002377*x.^3.*(0.02+0.062*((2*960)./(0.002377*37*x.^2)).^2); plo...

16일 전 | 0

답변 있음

Please help me convert them into a function of theta

When you get such an error, your first action would be to look at the sizes of the variables you use: whos r wab L r theta Nex...

Please help me convert them into a function of theta

When you get such an error, your first action would be to look at the sizes of the variables you use: whos r wab L r theta Nex...

17일 전 | 0

답변 있음

ODE 45 range for the variables

If you want to start your ode-integration at an [x,T]-point of [0,298] you have to define your y0 like this: y0=[0 ; 298]; %ini...

ODE 45 range for the variables

If you want to start your ode-integration at an [x,T]-point of [0,298] you have to define your y0 like this: y0=[0 ; 298]; %ini...

18일 전 | 0

답변 있음

Matrix product and inversion speed up

My comment still seems relevant. A simple commandline test gives: tic,AA = ones(3e4,2)*(ones(2,3e4)*ones(3e4,1));toc % Elapsed...

Matrix product and inversion speed up

My comment still seems relevant. A simple commandline test gives: tic,AA = ones(3e4,2)*(ones(2,3e4)*ones(3e4,1));toc % Elapsed...

22일 전 | 0

답변 있음

Getting an unknown error on calculating Standard Deviation.

Your variable v is a uint8. Try: std(double(v)) HTH

Getting an unknown error on calculating Standard Deviation.

Your variable v is a uint8. Try: std(double(v)) HTH

22일 전 | 0

답변 있음

Evaluate the triple integral and sketch the given solid

Whenever you are faced with a problem to solve start trying to solve it with the methods at hand. 1, You surely know how to do ...

Evaluate the triple integral and sketch the given solid

Whenever you are faced with a problem to solve start trying to solve it with the methods at hand. 1, You surely know how to do ...

22일 전 | 0

답변 있음

How to make a double integration with numerical integration?

Why not use integral2 to integrate over 2-D domains - it can handle, at least, boundaries in the y-direction that are functions ...

How to make a double integration with numerical integration?

Why not use integral2 to integrate over 2-D domains - it can handle, at least, boundaries in the y-direction that are functions ...

22일 전 | 0

답변 있음

How to show a deformation of a sphere

Keep track of the x, y, and z-lims or the axis-limits. Something like this: tiledlayout(1,2); [X, Y, Z] = ellipsoid(0,0,0,1,1,...

How to show a deformation of a sphere

Keep track of the x, y, and z-lims or the axis-limits. Something like this: tiledlayout(1,2); [X, Y, Z] = ellipsoid(0,0,0,1,1,...

23일 전 | 0

| 수락됨

답변 있음

ODE system with variable parameter, Boundary conditions and domain

This could be done something like this: Dall = {0:0.1:1,0:0.1:2}; % however many domains you need etc Y0 = {[Tt01;Pt01;M01],[T...

ODE system with variable parameter, Boundary conditions and domain

This could be done something like this: Dall = {0:0.1:1,0:0.1:2}; % however many domains you need etc Y0 = {[Tt01;Pt01;M01],[T...

23일 전 | 0

| 수락됨