Respondida
Variable called angle (name conflict)
I can think of two immediate ways to deal with this. But, as you've pointed out, it is of course best not to mix variable and fu...

más de 13 años hace | 1

| aceptada

Respondida
Output numbers, but WITHOUT a new line.
What you describe is not entirely impossible, tic while toc < 3 S = sprintf('x = %f\ny = %f',rand,rand); ...

más de 13 años hace | 2

Respondida
how to calculate the maximum of different parts of a vector without using a for loop?
Although I don't recommend programming like this in MATLAB, sometimes writing out the logic out explicitly can make it run extre...

más de 13 años hace | 3

| aceptada

Respondida
bwdist feature transform output is wrong class and imprecise?
After checking on this, you're right. In R2010b, it was returning IDX as a single, and because a single can only represent conse...

más de 13 años hace | 0

| aceptada

Respondida
how to determine the best tangential at every points from a freehand line?
The SMOOTH function from the Curve Fitting Toolbox might help. This seems to work well for me: h = imfreehand('Closed',fals...

más de 13 años hace | 1

Respondida
How to solve multiple ODEs to fit empirical observations by optimizing multiple constants?
Below is an example that does exactly what you are describing. Save it into a file and run it. First I just made some sample dat...

más de 13 años hace | 0

| aceptada

Respondida
removing objects which have area greater and lesser than some threshold areas and extracting only the objects which have the area in between
Given some image, for example (just to make a random image): I = conv2(randn(500),ones(10)) > 10; imshow(I); To keep...

más de 13 años hace | 5

| aceptada

Respondida
Improve computation speed of function
Your function is a convolution. I think it could be written more simply like this: function output=del2_83(input,dx) K...

más de 13 años hace | 3

Respondida
Binary matrix incrementer speed
You should be able to do it faster by calculating the matrices all at once and storing the result, instead of doing it one by on...

más de 13 años hace | 2

Respondida
curve fitting with numeric array instead of analytic form for function of x
If I understand you correctly, then I think all you need is the "backslash" operator. Just like this: x = (0:0.1:10)'; ...

más de 13 años hace | 1

Respondida
Faster method for polyfit along 3rd dimension of a large 3D matrix?
This can be accomplished in a fraction of the time with some matrix operations. dataCube = rand(100,100,300); sizeCube ...

más de 13 años hace | 7

| aceptada

Respondida
Counting the neighbors in matrix
R = randi([0 7],100); % Input H = zeros(8); % The 8x8 Matrix for k = 0:7 C = conv2(double(R == k),[1 1 1; 1 0 1...

más de 13 años hace | 1

Respondida
AQB+CQD=E - how to solve for Q?
Just making some test data... A = randn(12,6); B = randn(6,12); C = randn(12,6); D = randn(6,12); Q_true = diag...

más de 13 años hace | 0

| aceptada

Respondida
Run a simulink model for a certain amount of time and pause
If you know the times that you want to stop and restart it at, could you maybe use the SimState to resume the simulation, someth...

más de 13 años hace | 2

| aceptada

Respondida
How to solve an equation of motion with the ode solver when the spring constant is dependent on the position of the solution of the equation of motion
There is absolutely no problem in using MATLAB's ODE solvers to solve a problem like this. Say for example k(x) = 1+x^2 T...

más de 13 años hace | 1

| aceptada

Respondida
Circular indexing of an array
X = 1:10; ifft(fft(X).*fft([1 1]/2,numel(X)))

más de 13 años hace | 1

Respondida
Get numeric handle of imline, impoint etc hggroup
One way to do it: h = imline; numeric_handle = findobj(h,'-depth',0)

más de 13 años hace | 0

| aceptada

Respondida
Problem using ind2rgb and CDataMapping
You need to call IND2RGB with a colormap that is as big as your data. Something like this: M = round(5000*rand(300,300)); ...

más de 13 años hace | 0

| aceptada

Respondida
plot 3D curve with color-coded direction
Yes, you can do this in MATLAB. But it is easier to use a "surface" (in this case, I am calling MESH) to plot it instead of a li...

más de 13 años hace | 3

| aceptada

Respondida
how to get a integral vector result very fast with the upper limits which are supplied in an array?
Using ODE45 to do the integration might be faster than using quad, particularly if your x is large: tempFunction = @(tVari...

más de 13 años hace | 4

Respondida
Creating masks of open lines with imfreehand and impoly ROI tools
If I understand you correclty, you want to create an image of the line, without closing the curve. That's certainly doable. ...

más de 13 años hace | 1

| aceptada

Respondida
How to vectorize this loop ?
You are calling regress with two vectors. That is the same as a projection using the dot product. So then your code could be wri...

más de 13 años hace | 0

| aceptada

Respondida
How can I create a matrix where every combination of numbers between 0 and 1 (step x) is used and every row sums to one?
I like andrei's method, but it will will run out of memory quickly when step is small! Here is a better implementation of the...

más de 13 años hace | 1

Respondida
How to pick n random points on a sphere
I also do not understand what you mean by connecting 4 points on a sphere, but to answer the first part of your question, th...

más de 13 años hace | 2

Respondida
Non Linear Fit help?
"How do you go from log10 parameters to estimating the error in the parameter itself using COVB??" It's very easy, you just u...

más de 13 años hace | 0

Respondida
Non Linear Fit help?
Ah! Sorry sorry sorry. There's actually a MUCH easier way to make all of this work. The important point is to set the model equ...

más de 13 años hace | 0

Respondida
Non Linear Fit help?
This problem is clearly difficult. It has multiple minima, and a strong dependence on initial conditions. Instead of NLINFIT, I ...

más de 13 años hace | 0

Respondida
calculate the correlation of a number of time series
diag( corr( bsxfun(@minus, sum(data,2), data), data) )

más de 13 años hace | 0

Respondida
Evaluate advanced integral numerically
Ah, ok. Then you'll have to do it the hard way, like this: myquad = @(fun,a,b,tol,trace,varargin)quadgk(@(x)fun(x,varargin{...

más de 13 años hace | 0

Respondida
Evaluate advanced integral numerically
This integral can be calculated in MATLAB. The integrand as written in your link is: J = @(x,y,z,f) sqrt(x.^2+y.^2)./sqrt...

más de 13 años hace | 2

| aceptada

Cargar más