Answered
Question about fminsearch with vector input and output
When I run your code, I get the exit message below. Did you not get the same? Exiting: Maximum number of function evaluations h...

5 years ago | 0

| accepted

Answered
why vectorization becomes slower?
One reason is that you are extracting the same submatrices multiple times. For example, the expression uyt(2:n+1,2:m+1) appears ...

5 years ago | 1

| accepted

Answered
Computation of sum/product of triple integral using function handle
If you can do this for a single y_i, then it should be trivial for multiple y_i. Note that the y_i can be factored out of the in...

5 years ago | 1

Answered
Replacing all occurrences of a specific value in a matrix with another value
im2=im3(im2);

5 years ago | 0

| accepted

Answered
Intersection between a circle and a line.
One way, [dx,dy]= ndgrid( (-a:b)-cx , (-a:b)-cy ); factor=r./sqrt(dx.^2+dy.^2); Z=[dx(:),dy(:)].*factor(:)+[cx,cy];

5 years ago | 0

Answered
fmincon freezing (no NaN or Inf is involved)
You might try getting rid of these lines in Vfunction() value = -vq; if isnan(value) value = 0; end if isinf(value) ...

5 years ago | 0

Answered
How to create a matrix where the value shifts to the write with each row? And how do I create a vector that increases and then decreases?
F=[10E-1 10 10E-1 10E-2 , (9:-1:1)*1e-3]; toeplitz(F,[F(1), zeros(1,numel(F)-1 )])

5 years ago | 0

Answered
lsqnonlin triggering error for incompatible array sizes
I don't think you are missing something obvious, but it is doubtful that the problem is in the lsqnonlin algorithm. Use dbstop t...

5 years ago | 0

Answered
How to Finding Principle Axis and Determining the Specific Shape?
The principle axes you can find with svd(), XY=[X(:),Y(:)]; %the scattered data mu=mean(XY); P=svd(XY-mu,0); %P contains the ...

5 years ago | 0

| accepted

Answered
Retreiving equations from a matrix
syms B eq T23 T22 T32 T33 B =[50, 100, 100, 200; 50, T23 - 4*T22 + T32 + 150, ...

5 years ago | 0

| accepted

Answered
Modify attributes of inherited property
Not directly, but you can overload the display() method, customizing it so that C is never displayed at the command line. Simila...

5 years ago | 1

| accepted

Answered
How to remove this error?
The error message is telling you that synth only has 2048 rows, but nt+t0_i is greater than 2048, i.e., you are trying to index ...

5 years ago | 0

Answered
How can I plot the mean squared errors being calculated by the imregister function?
MSE=norm(modified-fixed,'fro')^2/numel(fixed); or MSE=mean(abs(modified-fixed).^2,'all');

5 years ago | 0

Answered
Array indices must be positive integers or logical values. with max values?
Probably because you created a variable named "max" earlier in the code, which is now shadowing the max() function. Incidentall...

5 years ago | 1

| accepted

Answered
Struggling with fminsearch with vector inputs
Your objective function is not returning a scalar value at Kp=aconst1. We cannot know what objective you truly intended. Regard...

5 years ago | 0

| accepted

Answered
How do you plot a circle with a str2func()?
No idea why you think str2func should be part of the task. Why not simply, fimplicit(@(x,y) x.^2+y.^2-100,11*[-1,+1,-1,+1]); ax...

5 years ago | 0

Answered
Whats the error in the following code
Probably that you have 2 equal signs in the function signature.

5 years ago | 2

Answered
How can I combine mustBeA and mustBeNumeric in argument validation functions
You could write your own custom validation function for such a purpose, e.g., % Custom validation function function mustBeNume...

5 years ago | 1

| accepted

Answered
Find blocks inside a large sparse matrix
The spy() command?

5 years ago | 0

Answered
How to avoid recursion with parenReference
Classic subsref doesn't seem to difficult in this case. You can't beat the classics! function varargout = susbref(obj,S) ...

5 years ago | 0

| accepted

Answered
multiple axis joint rotation
I have used scatter3 to plot 3 different data sets that are contained within the same volume (x,y,z) If so, why are you attempt...

5 years ago | 0

Answered
multiple axis joint rotation
hlink = linkprop([axcb1,axcb2,axcb3],{'CameraViewAngle','CameraPosition','CameraUpVector'})

5 years ago | 0

Answered
How can I define a derivative and norm function inside an integral in matlab?
The norm would just give a scalar independent of t. Its integral from 0 to 1 would be trivial. Perhaps you meant instead to do, ...

5 years ago | 0

| accepted

Question


Why can't or why shouldn't Matlab "re-shadow" functions after eval() is called?
I know eval() is not to be encouraged. Nevertheless, I still wonder why errors like in the code below are still around after so ...

5 years ago | 1 answer | 0

1

answer

Answered
How to calculate sum(A .* (B * C), 'all') [Ed. actually sum(A .* log(B * C), 'all')] efficiently when A is sparse and B*C is full and large?
One more way, [kj,ki,a]=find(A); C=C.'; accum=0; for n=1:K accum=accum+ B(kj,n).*C(ki,n); end result=log(accum).'*a;

5 years ago | 2

Answered
How to avoid eval when eval seems unavoidable
One way to avoid eval in this case is to use an automatic code-writing tool instead of unpacking at run time. I created the foll...

5 years ago | 1

Answered
union multiple arrays (more than two)
The obvious way it so use a loop, U=arrays{1}; %cell array containing arrays for i=2:N U=union(U,array{i}); end...

5 years ago | 0

| accepted

Answered
Counting x times zeros in a row on a given sequence
Using, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vectors x=ra...

5 years ago | 0

Answered
Calculating the between-column squared correlations
I would guess it's account for the symmetry of the y matrix ... so that off-diagonal terms will not be double counted.

5 years ago | 0

| accepted

Answered
How can i get optimization or interpolation value for this 3-data?
i want to get minumum z value That would simply be [zmin,loc]=min(z) Did you mean you also want the corresponding values of x...

5 years ago | 0

Load more