Answered
How can I sort a string both alphabetically and numerically?
Very ugly, but works: UnsortedText = {'BBB 1'; 'AAA 10'; 'AAA 9'; 'AAA 1'; 'BBB 2'; 'BBB 19'; 'BBB 9'; 'CCC 0'; 'CCC 9' ;...

13 years ago | 6

| accepted

Answered
solid contour lines for some specific values of a contourf plot
The userdata property of each patch is set to the level's value. You can use this to find the relevant patch, and make its line ...

13 years ago | 0

| accepted

Answered
can you plot a image? (line by line or pixel by pixel)
One idea would be to use the AlphaData property. This sets the transparency of each pixel: A = im2bw(rand(10,7)); M = ze...

13 years ago | 1

Answered
Finding distance between point and edge of image mask
I think what you are looking for is the BWDIST function. help bwdist

13 years ago | 1

| accepted

Answered
Need help - How to generate predefined subsets?
Another idea: [C1,C2,C3,C4] = ndgrid(1:5); allCombinations = [v(C1,1) v(C2,2) v(C3,3) v(C4,4)] Or a more flexible way...

13 years ago | 0

Answered
Vectorization in an array of structures?
Not sure there's an easy way to do that. There is this, but I don't see much benefit over using a loop. N = num2cell([S....

13 years ago | 0

Answered
Extracting points from an interpolated surface (Lowess fit)
You can directly call your FIT object with the points you want to evaluate. Like this: fitresult(3,4) fitresult([1 2 ...

13 years ago | 0

| accepted

Answered
Analytically and numerically computed arc length
I'm not sure how you are analytically calculating path length. It seems from your expression that you just integrated r(t) strai...

13 years ago | 1

| accepted

Answered
Imposing additional constraints while using 'lsqnonneg'
I think this should work. If you are minimizing ||Cx - d|| First, remove the first and last columns of C, and call LSQNON...

13 years ago | 1

Answered
Numerical approximation of projectile motion with air resistance
You are forgetting to update v inside your loop. v = sqrt(vx^2 + vy^2); Right now it is sitting at v = 50 the whole time. ...

13 years ago | 3

| accepted

Answered
how plot results of a 3d matrix
These two commands shoulds be useful: help isosurface help slice

13 years ago | 0

| accepted

Answered
Simple Solve command not working.
When you use solve with a string input, it interprets the "E" as exp(1). Try this: solve('x = E', 'x') If you really wa...

13 years ago | 1

Answered
Multivariate Regression Parameter Optimization
NLINFIT is good. NonLinearModel.fit is also good. But since your problem involves fitting a surface with only two indepe...

13 years ago | 0

| accepted

Answered
Correcting a Non-Uniform Background
One example that uses morphological operations is here: <http://www.mathworks.com/products/image/examples.html?file=/products...

13 years ago | 0

Answered
Deleting duplicate images in 3-dimesional matrix
%First, I'll make some sample data with some duplicates: A = rand(200,200,50); A(:,:,16) = A(:,:,41); A(:,:,32) = A(:...

13 years ago | 0

| accepted

Answered
remove sidewalls from surface plots
There are several ways, for example by replacing points with NaN, but they often give mixed results as far as appearance. The co...

13 years ago | 1

| accepted

Answered
Numerical Solution
Ok, your "q" will have an imaginary component, so you cannot use fzero directly. You can, however, solve it using fsolve, where ...

13 years ago | 0

| accepted

Answered
How to convert easily *.mat files to *.m files
Do you happen to have Simulink? There is the "Simulink.savevars" command that will write variables into a readable MATLAB script...

13 years ago | 4

| accepted

Answered
Programmatic polynomial fitting with mutliple measurements and known parameters
If I understand this correctly, you want model something as y = f(x1,x2,x3,x4), where f is a polynomial of some sort. You hav...

13 years ago | 1

| accepted

Answered
How to keep aspect ratio fixed, when rotating 3D objects in GUI?
Maybe this will do what you are trying to accomplish? axis vis3d

13 years ago | 6

Answered
Find Min& Max Togather
The Neural Network Toolbox actually already has a function to do this called MINMAX. It calculates the min and max of each row o...

13 years ago | 0

Answered
compute determinant using Cholesky decomposition
You could try prod(diag(chol(A)))^2 But I have no idea if/when this would be faster than simply det(A).

13 years ago | 0

Answered
System of three differential equations
So you have experimental data (S(t),I(t), and R(t)), and you are trying to find the parameters (a and r) that will make the ODE ...

13 years ago | 0

Answered
Graph a plane spanned by 2 vectors
The way you are calliing EZMESH inteprets the input as z = f(x,y). So you can't express things like the x=0 plane. But what y...

13 years ago | 1

Answered
Recommendations for evaluating a 6-D Integral
Assuming that "gamma" and "psi" are the same thing, are you sure your integrand is correct? Look at when theta = psi = pi/2...

13 years ago | 0

Answered
Recommendations for evaluating a 6-D Integral
Here's a simple idea. If your integrand is more or less smooth. Evaluate it on a number of different coarse grids, and then extr...

13 years ago | 0

Answered
Curve Fitting
As proecsm points out, your data needs to be made into columns. Like this: x = 1:1000; %Row vector y = sin(0.01*x) + cos...

13 years ago | 1

Answered
dsolve problem
One way would be to convert f to a string: syms x y f f=x y=dsolve(['D2x=-' char(f)],'x(0)=1','Dx(0)=0')

13 years ago | 1

| accepted

Answered
Trouble Evaluating an Integral
If you are using R2012a, you can try using INTEGRAL3 In any case, since you are integrating in spherical coordinates, you nee...

13 years ago | 1

| accepted

Answered
Eliminating Imaginary Numbers in an Array
Array = [-1/8 -1/16 0 1/16 1/8]; NewArray = nthroot(Array,3)

13 years ago | 0

| accepted

Load more