Question


Reloading handle objects from .mat files
Why does isequal() return false when the reloaded handle is compared to the original handle, in the code below. h=plot(1:5); s...

3 years ago | 2 answers | 0

2

answers

Answered
Solve linear equation in matrix form with least square method
If I use (A.'*A)\(A.'*b), i can get the result An even easier and more accurate way to get it is, x=A\b and that is the meth...

3 years ago | 0

| accepted

Answered
Interpreting the results of 'fsolve'
It means fsolve thinks it found a solution. Whether you can "trust" the solution is an open-ended question. It depends on the ap...

3 years ago | 0

Answered
using matchpairs when objects have different capacities
Then you are not seeking pairings. Therefore, matchpairs will not apply. But you can probably use minL1intlin from this FEX down...

3 years ago | 0

Answered
Coding volume segmentation with multiple thresholds (CT data)
I can iterate through different CT number thresholds, using a function to create a binary mask (a 3D matrix) at each. However, I...

3 years ago | 0

| accepted

Answered
Attempt to grow array along ambiguous dimension
In this line, idealF1(distance4 <= D01)=0; you have not checked the size of distance4 and of idealF1.

3 years ago | 0

Answered
want to plot ellipses with different a and b values in x^2/a^2 + y^2/b^2 = 1 in Matlab 3d plot
Simplie enough. a=0.1;b=0.15; fsurf(@(x,y) x.^2/a^2+y.^2/b^2) ;

3 years ago | 0

Answered
How do I fit two data sets to each other?
Sounds like a 1D image registration problem. Maybe consider imregtform.

3 years ago | 0

Answered
Trying to do an if/and statement on a vector but have an addition apply to only one element of vector
I think a better method would be to update the compass position incrementally, using the attached file cumangle.m t=linspace(-1...

3 years ago | 0

Answered
generate all variations on a 20-mer, that are 1 to 4 mismatches away
Using blkColon from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/115340-block-transposition-permutat...

3 years ago | 0

| accepted

Answered
How can I make the numeric edit field blank?
You can set the ValueDisplayFormat property to %0.0d

3 years ago | 1

| accepted

Answered
How can we increase/decrease the number of triangles in a triangulation that is created from a polyshape object?
Another way: p1=nsidedpoly(6); p2=p1.scale(0.5); P=subtract(p1,p2); P=subTri(P); for i=1:3 P=splitTri(P); end pl...

3 years ago | 0

Answered
creating multiple arrays that all have the same name with different number
You wouldn't do that. You would instead combine all the calculations into a single matrix Gcr: density = 1000; g = 9.8; gamma...

3 years ago | 1

| accepted

Answered
How can we increase/decrease the number of triangles in a triangulation that is created from a polyshape object?
To increase the number of triangles, you would have to add vertices along the edges, like in the following: p1= polyshape([0,0;...

3 years ago | 0

Answered
How to make the output size of imwarp the same as the input?
There is an OutputView input parameter that will let you control that, https://www.mathworks.com/help/images/ref/imwarp.html#bt...

3 years ago | 0

| accepted

Answered
Optimization to fit a curve to data (problem with the InitialPopulationMatrix)
Instead of x = 1:size(Data,2); perhaps try a more normalized range of x, e.g., x=linspace(0,1,size(Data,2))

3 years ago | 0

| accepted

Answered
Solving for different types of variables on large dataset with lsqnonlin
You could imoplement a nested optimization, with the outer optimization over a done with fminsearch while that over T can be don...

3 years ago | 1

| accepted

Answered
How to assign elements in a vector to an entry in a structure array variable?
You could also consider using a table instead, Names=["Jon","Phil","Bob","Gary"]'; T=table(Names,nan(size(Names)), 'Var',["N...

3 years ago | 0

Answered
How to assign elements in a vector to an entry in a structure array variable?
You could also consider using dictionaries instead of a struct array, Names=["Jon","Phil","Bob","Gary"]; D=dictionary(Names,...

3 years ago | 0

Answered
change outputlayer in layergraph object
For example, lgraph=layerGraph(regressionLayer) layers=lgraph.Layers; layers(end).Name='newName'; lgraph=layerGraph(la...

3 years ago | 0

| accepted

Answered
I have data in 3D array and I know indices in the first two dimensions. How do I collect all data without for loop?
One way Data(:,:,1) = [1,2,3 4,5,6 7,8,9]; Data(:,:,2) = [11,22,33 44,55,66 77,88,99]; idxRow = [1,1 ...

3 years ago | 0

Answered
How to assign elements in a vector to an entry in a structure array variable?
But I want to avoid loops because my code is already within another large loop which is slow. When dealing with structs, there ...

3 years ago | 0

| accepted

Answered
Passing a variable constraint to fmincon
I think this is what you mean, for nn=1:N ynn=y(nn); FUN = @(x)((sqrt((x(1) - a)^2 + (x(2) - b)^2) + sqrt((x(1) - ...

3 years ago | 0

| accepted

Answered
Convolutional neural networ for classification problem with matrices instead of images
Since I'm dealing with .csv files i have to use the "tabularTextDatastore" command to create the datastore. No, just use an ima...

3 years ago | 0

Answered
I'd like to remove variables (columns) containing specifc name
One way, idx=contains(T.Properties.VariableNames,"_B" | "_A"); %T is your table T(:,idx)=[];

3 years ago | 0

Answered
Inverse of a matrix
%Fake input data B=rand(100); X1=rand(100,1); X2=rand(100,1); A=B*(X1+X2); %Now invert X2_recovered=B\(A-B*X1); norm(...

3 years ago | 0

| accepted

Answered
how can i extract features just before full connected layer : extract the features from the flatten layer
Use the activations command, act = activations(net,yourInput,14);

3 years ago | 0

Answered
how can i extract features just before full connected layer : extract the features from the flatten layer
Convert the network to a dlnetwork and remove the last two layers. lgraph=layerGraph(net); lgraph(end-1:end)=[]; %remove outpu...

3 years ago | 0

Answered
add image to legend label
The easiest way I can think of is to make several subplot axes, including one containing the line plot subplot(1,2,1); plot(1:5...

3 years ago | 0

Answered
How to make variables stored in cell arrays always show up as data type and size instead of listing the elements?
I don't think there's any way to do it in the variable editor, but you can do it at the command line using this solution, https...

3 years ago | 0

| accepted

Load more