Answered
concatenate array of structures with same field names
So why is it that Matlab cannot use fread to read a structured file? Not sure how fread is implemented (does it use C++ fread or...

3 years ago | 0

| accepted

Answered
double conditional in one line
You need to be using '&' x=0.23; 0<x & x<1

3 years ago | 0

Answered
Extract pixels inside the area between 2 edge lines
[m,n]=size(I); mask=poly2mask(POLYOUT.Vertices(:,2),POLYOUT.Vertices(:,1), m,n); pixels=I(mask)

3 years ago | 0

| accepted

Answered
Minimum distance between 2 points
Use pdist2

3 years ago | 0

Answered
Concatenate string with table
writematrix(header,'filename.txt'); writetable(tab_data,'filename.txt',WriteVariableNames=false,WriteMode='append');

3 years ago | 0

| accepted

Answered
Vectorization/increase efficiency of nonconvex optimization problem using systematic initializations
It is not clear that a vectorized approach would help you, because the time for each of the optimizations to converge would be ...

3 years ago | 0

| accepted

Answered
Constants that cannot be delete with CLEAR
You could make the constants the Constant properties of a class. Then they can be reused even after issuing clear classdef myco...

3 years ago | 1

| accepted

Answered
Optimization not working because fitness function must be a function handle
problem.objective = ... @(x) [+0.0365*x(1) - 0.18*x(2) + 0.389; 0.0435*x(1) - 0.266*x(2) + 4.2*x(3) + 0.019*x(1...

3 years ago | 0

Answered
Add properties to edit field in app designer
It might be better to use a 3rd party tool like, https://www.mathworks.com/matlabcentral/fileexchange/19729-passwordentrydialog...

3 years ago | 0

| accepted

Answered
Add properties to edit field in app designer
You can always use the EditField's UserData property to hold extra stuff. However, there's no reason the true password needs to ...

3 years ago | 0

Answered
Scalar structure required for this assignment.
Your intention with the code is not clear, but here is one possibility, [Sis.On]=deal(D_{:,2});

3 years ago | 2

| accepted

Answered
Finding intersection of line(vector) and an unclosed shape
Use polyxpoly if you have the appropriate toolbox. Otherwise, use this FEX download, https://www.mathworks.com/matlabcentral/fi...

3 years ago | 0

Answered
how to calculate the area of each bin of intersection of a circle and mesh grid?
The efficient way would be to first eliminate the grid squares which are wholly inside or outside the circle, which you can dete...

3 years ago | 0

Answered
lsqnonlin optimization: large condition number of Jacobian matrix at all iterations, but full rank
Your scaling isn't really doing anything meaningful, since all residuals are weighted equally. Really, you are just multiplying ...

3 years ago | 1

| accepted

Answered
Solving a complicated symbolic equation
A=3; B=9; f=@(x)A-B*x*sinh(x); [x,fval]=fzero(f,[0,10]) %first solution [x,fval]=fzero(f,[-10,0]) %second solution

3 years ago | 1

Answered
All functions in a script must be closed with an 'end'.
Replace "return" by "end"

3 years ago | 0

| accepted

Answered
Extract "labelhandles" from Legend
Would it be possible to get the content of the second output of the legend, i.e. "labelhandles", just by calling the first outpu...

3 years ago | 2

| accepted

Answered
Looping scatteredInterpolant across each frame in 3D matrix
Since your grids are related by an affine warping, it might be best to use imwarp, assuming you have the appropriate toolbox.Exa...

3 years ago | 0

Answered
How to plot a function on a user defined plane when using spherical coordinate system by specifying elevation and azimuth values at a given radial distance?
The three spherical coordinates theta, phi, and r are not enough to define the sampling of a plane. You must also define coordin...

3 years ago | 0

Answered
Calculation errors while using subs and det functions
You haven't given us access to the input variables needed to repeat the computation. However, the determinant you are evaluating...

3 years ago | 0

| accepted

Answered
Extracting from boxchart function the median, quartiles, and whisker data.
I don't believe those quantitites are directly available as permanent property data. When you position the cursor over one of th...

3 years ago | 1

| accepted

Answered
How to define the order of layers/plots and axes?
1) Hfig=figure('Visible','off); p(1) = plot(...); p(2) = scatter(...). p(3) = line(..); p(4) = fill(...), p(5) = imagesc(...) ...

3 years ago | 1

| accepted

Answered
error in the process of symbol operation of the matrix
Nothing is wrong with T, though possibly you didn't scroll down far enough to see the definitions of all the sigmas.

3 years ago | 0

Answered
Is it possible to handle a slider with an 'on-line' update? I mean, updating the value continously during the sliding.
Yes, use the ValueCHangingFcn callback https://www.mathworks.com/help/matlab/ref/uislider.html#buicpgg-1_sep_shared-ValueChangi...

3 years ago | 0

Answered
How to extract rows of data according to text containing specific words in cells in Matlab
copepods= contains(C.object_id,"cruise2012") & ... contains(C.object_annotation_hierarchy,"Copepoda");

3 years ago | 0

| accepted

Answered
lsqcurvefit does not follow convergence criteria in summation.
After the fit has converged (but not giving a useful result) I checked for the convergence criterion and it wasn't replaced with...

3 years ago | 0

| accepted

Answered
Unrecognized function or variable 'x0'.
Relocate the last 2 lines from newmintafun1 and make x0 the correct length. x0 = [10; 6; 4; 3; 4; 3; 2; 3; 18; 7; 25; 10; 5; 5;...

3 years ago | 0

| accepted

Answered
How to create big matrix that the item is small matrix
See, How to Generate a Block Toeplitz Matrix. Then replace the last D block with F, Matrix(end-11:end,end-11:end)=F;

3 years ago | 0

Answered
Fit gaussian surface on 3D data
Using gaussfitn from, https://www.mathworks.com/matlabcentral/fileexchange/69116-gaussfitn load Image %cropped to include onl...

3 years ago | 1

| accepted

Load more