Respondida
Blackbody curve fitting to data
This looks uggly. Matlab impresses me in this case, in that it still manages to obtain some kind of result. The uggliest problem...

más de 5 años hace | 0

Respondida
3D surface plot with three vector
Since you have 3 1-D arrays you would first have to do some processing to get to a surface-plot. But you should start by looking...

más de 5 años hace | 1

| aceptada

Respondida
Filling matrix with zeros whilst retaining original value
Something like this? a = randn(1,14); a(end+1:180) = 0; HTH

más de 5 años hace | 1

| aceptada

Respondida
least absolute deviation when we have data set
You can do it rather straight-forwardly with fminsearch (or other similar tools on the file exchange: fminsearchbnd, minimize et...

más de 5 años hace | 1

| aceptada

Respondida
surface polar plot /range vs angle plot
You can have a look at polarPcolor on the file exchange. It worked as advertised, it managed to make such plots for my use-case...

más de 5 años hace | 0

| aceptada

Respondida
How to calculate the gradient of 3D velocity
Unfortunately you will have to do something like this: [dudx,dudy,dudz] = gradient(u,squeeze(x(1,:,1)),squeeze(y(:,1,1)),squeez...

más de 5 años hace | 0

| aceptada

Respondida
Finding daily maximum & minimum temperature; and time when maximum & minimum temperature occurs
It seems to me that something like this reformats your temperature data right and extracts the daily peak temperature and its "h...

más de 5 años hace | 0

Respondida
Solving n x m non-linear equation systems where n > m
If you look at your equations, you can rewrite them (as far as I understand) to: This you can treat as a linear system in x(3...

más de 5 años hace | 0

| aceptada

Respondida
Can a function known whether/which specific output is ignored (tilde operator)?
I'll merge parts of two of my comments to provide a KISS-type suggestion: In a "gentle-downhill-slope-home" use-case you might ...

más de 5 años hace | 1

Respondida
How do I perform a truncated SVD on a matrix?
Simply use the standard svd-function, then you can simply calculate the reconstruction-error at different truncation-levels by s...

más de 5 años hace | 1

| aceptada

Respondida
Why is memory reduced for an identical copy of a sparse array?
It seems to be so that your difference of 16 bytes is simply due to the longer name of your AA: AA = sparse([1,1,2],[1,1,2],[pi...

más de 5 años hace | 0

Respondida
Overlay gradual circular blur/fade over image
That seems like a reasonably simple task to do, if I've understood what you want to get done that is... Maybe something like th...

más de 5 años hace | 0

| aceptada

Respondida
ode solver returns too many results
When you get an error in matlab instantly set the debugger on: dbstop if error then rerun the command that caused the error, t...

más de 5 años hace | 1

Respondida
How to plot three functions in three separate figures and simultaneously in one figure but in three different windows of the same figure?
When you create figures you can do something like this: fig1 = figure; fig2 = figure; fig3 = figure; Then when you want to p...

más de 5 años hace | 0

Respondida
Generation of random numbers in batches
if you know from the start how many point in each set just do something like: a2 = randn(1,num_points_in_a2); a = a2(1:min(num...

más de 5 años hace | 0

Respondida
Animated X, Y scatter plot
Have you tried to look at scatter? That should let you do this simply like this: for i1 = 1:10:(numpoints-10), plot(xP(1:i...

más de 5 años hace | 0

| aceptada

Respondida
Why can't OCR detect the text in this photo?
It seems to have something to do with automatic thresholding. If I cut out most of the black background it seems to work just fi...

más de 5 años hace | 0

| aceptada

Respondida
solve differential equation with matrix
Yes your system of ODEs are on the form (with singular mass-matrix, C) that ode23t and ode15s can handle, at least according to ...

más de 5 años hace | 0

Respondida
Matrix integral over layers
For this I would try cumtrapz - it calculates the cumulative (sp?) trapezoidal integral in the same manner as cumsum calculates ...

más de 5 años hace | 0

Respondida
Matlab shrinking subplot graphs when running the code
Sometimes that (used to) happen, as far as I understood it had something to do with repeated plotting (possibly with titles and ...

casi 6 años hace | 0

Respondida
Pcolor equivalent for 3D array
The type of plot you've presented is easily reproduced by this: [x,y,z] = meshgrid(0:3,0:4,0:5); F = floor(4*rand(size(x))); ...

casi 6 años hace | 0

| aceptada

Respondida
Pcolor equivalent for 3D array
For visualization of 3-D data matlab has a couple of builtin functions: slice, scatter3 and isosurface. They does tasks at least...

casi 6 años hace | 0

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 1

| aceptada

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

casi 6 años hace | 1

| aceptada

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

casi 6 años hace | 0

| aceptada

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

casi 6 años hace | 0

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

casi 6 años hace | 2

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

casi 6 años hace | 0

| aceptada

Cargar más