Answered
Optimization With Genetic Algorithm. Could not define objective Function!
1: But further in the constraints section i need decision variables as a matrix so i can write my constraints. ( Because they a...

4 years ago | 0

Answered
How to store rows of matrix into cell array?
tab = magic(5); v_r=num2cell(tab,2)

4 years ago | 1

Answered
Make 256by 256 by for loop
b=repmat(linspace(0,1,128),128,1); e=ones(size(b)); I=[b, e;e,fliplr(b)]; I(116:140,116:140)=0; imagesc(I); colormap(gra...

4 years ago | 1

| accepted

Answered
How to change the appearance of the boxplot with a whiskers?
A = [1.128 0.701 0.562 0.469 0.836 0.644 0.510 0.535 0.528 0.585]'; B = [0.630 0.630 1.079 0.635 0.983 0.875 0.747 0.811 0.878 ...

4 years ago | 2

| accepted

Answered
fit() from Curve Fitting Toolbox not working even with examples from the documentation
Run the code inside a function, >> myfunction function myfunction load franke sf = fit([x, y],z,'poly23') p...

4 years ago | 0

| accepted

Answered
Identify neighbours in image after finding regionprops centroids
I would create a polyshape for each of the regions based on the extrema that you found. You can dtermine whether 2 polyshapes p_...

4 years ago | 0

| accepted

Answered
How do I only delete NaNs that exist after a number but not before?
I would like to delete all NaNs that only exist after numbers As other's have told you, you cannot replace a matrix element wit...

4 years ago | 0

| accepted

Answered
Total lines of code of MATLAB product
I've seen geneal estimates that there 57e3 lines of source code per MB of object code. My app folder C:\Program Files\MATLAB\R20...

4 years ago | 0

| accepted

Answered
Fitting data with a exponentially modified gaussian equation
Because you are using a custom model, you need to supply an initial guess of the parameters under "Fit Options". Otherwise, the ...

4 years ago | 0

Answered
Get tangents (+ linear equation of tangents) of turning points in cfit graph
p=flip(coeffvalues(ft)); dp=polyder(p); ddp=polyder(dp); dddp=polyder(ddp); %3rd derivative r=roots(ddp); turingpoint...

4 years ago | 1

| accepted

Answered
How to optimize parameters that satisfy the equation.
First, you must fix the formula for f f = abs( 0.24 - abs(x*(0.05*y*exp(1i*z) + 0.02)) ); Second, you have 3 unknowns, so you ...

4 years ago | 0

| accepted

Answered
Jacobian Function in MATLAB
Do not give variables the same name as the function they are declared in. You have a variable named 'Jacobian' inside a function...

4 years ago | 0

Answered
How do I find the handle to the colorbar for a specific axes
Here is an excruciatingly roundabout method. function [Hcb,tf]=getColorbars(hAxes) %Return colorbar handles for axes with co...

4 years ago | 0

Answered
Creating a variable with the values in the same fields of different structures
Well, I won't give you a solution that creates separate variables, since there are standard hazards associated with that. Howeve...

4 years ago | 0

| accepted

Answered
A bit of MATLAB syntax fun
Unrecognized function x?

4 years ago | 0

Answered
How to combine multiple curve fits in one plot?
Use the cftool to export each fit to a workspace variable cfit1 and cfit2. Then plot(cfit1,Varname1,y); hold on plot(cfit2,Va...

4 years ago | 2

Answered
Fast Euclidean Distance Calculation
vecnorm(X-Y,2,2);

4 years ago | 1

Answered
How to address error message "Matrix is close to a singular or badly scaled" when lsqnonlin was already able to run a few times?
Try scaling your residuals so that they all have approximately the same sensitivity to changes in the parameters.

4 years ago | 0

| accepted

Answered
Chessboard illumination - Problems using imrotate
f1=255*ones(64); f2=zeros(64); R1=[f1 f2 f1 f2 f1 f2 f1 f2]; R2=[f2 f1 f2 f1 f2 f1 f2 f1]; chess=[R1;R2;R1;R2;R1;R2;R1;R2]; ...

4 years ago | 1

| accepted

Answered
Using fit function ignoring NaN
include=~isnan(y); fobj = fit(x(include),y(include),fitType)

4 years ago | 3

| accepted

Answered
Find consecutive ones and save the contents
Download this, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vecto...

4 years ago | 1

Answered
How do I load .mat file and take certain columns and make them an array?
You could do it with matfile(), as in this example: https://www.mathworks.com/help/matlab/ref/matlab.io.matfile.html#mw_630b601...

4 years ago | 0

Answered
how to count array of 1 and 0 repeated times
Using, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetitions-in-vectors [~,~...

4 years ago | 0

Answered
Speeding up to find minimum value using min() function
c=c(:)'; b=interp1(c,1:numel(c),s,'nearest'); a=abs(c(b)-s)

4 years ago | 3

Answered
fmincon - penalty function
Problems (1) The objective function code you've shown appears to depend on everything except the unknown variables x (2) Assum...

4 years ago | 1

Answered
inputParser does not throw error
The validation function should be the 4th argument, addParameter(p, 'property_name','', isString) ;

4 years ago | 1

| accepted

Answered
Perform angle recognition on the objects in the following images
Perhaps as follows, load Image BW = edge(im2gray(A)); for i=1:5 E=bwmorph(BW,'endpoints'); BW=BW&~E; end BW=b...

4 years ago | 1

Load more