Réponse apportée
Expanding a cell array in table into multiple rows
Here's a scaled-down example: T=table(1,2,3,{rand(4,3)}, {rand(4,1)}); T.Properties.VariableNames(end-1:end)=["A","B"] n=...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Camera calibrator (picture capture)
Yes, for single camera calibration, it shouldn't matter whether the camera or the pattern (or both) are moving, as long as you d...

plus de 2 ans il y a | 0

Réponse apportée
User Defined Functions in MATLAB
prodby2_kweave19(6) function product = prodby2_kweave19(N) product = prod(1:2:N); % User inputs N, as the argument to the...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Increasing lsqcurvefit/nlinfit speed
It would definitely be faster to attach the table as an external variable to an anonymous or nested function, than to freshly lo...

plus de 2 ans il y a | 0

| A accepté

Discussion


How to randomly permute a vector without calling numel(), length(), or size()
Given a vector v whose order we would like to randomly permute, many would perform the permutation by explicitly querying the le...

plus de 2 ans il y a | 7

Réponse apportée
How to interpolate one axis in a 3D data?
load dats; F=griddedInterpolant(ss); ss=F({1:139,1:48, linspace(1,9,100)});

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Using lsqnonneg to determine if there exists a solution to a (generally) under-determined linear system, but error is too large to be convincing.
A better way to investigate the existence of a solution to Aeq*x=beq, x>=0 might be (as below) to find the minimum distance betw...

plus de 2 ans il y a | 0

Réponse apportée
Using lsqnonneg to determine if there exists a solution to a (generally) under-determined linear system, but error is too large to be convincing.
There is nothing that can be inferred from the resnorm alone about the quality of the solution. 10^-3 is a very good result if t...

plus de 2 ans il y a | 0

Réponse apportée
Creating multiple cylinders in different coordinates
Using cylindricalFit() from this FEX download https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-...

plus de 2 ans il y a | 0

Réponse apportée
How many workers for fmincon with UseParallel?
Is the reason to set UseParallel to true when solving a problem with fmincon that it can potentially speed up the evaluation of ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to find the span of a matrix in matlab?
You can use this, https://www.mathworks.com/matlabcentral/fileexchange/77437-extract-linearly-independent-subset-of-matrix-colu...

plus de 2 ans il y a | 0

Question


Reliably determine RAM consumption of MATLAB variables
I am looking for a reliable way to determine how much RAM is devoted to Matlab variable data at a given moment. The whos() comma...

plus de 2 ans il y a | 1 réponse | 0

0

réponse

Réponse apportée
Error using trainNetwork - possible change with Matlab release?
Convert the data to cell array form. XTrain=num2cell(Xtrain,[1,2,3]); XTrain=XTrain(:); YTrain=num2cell(YTrain); YTr...

plus de 2 ans il y a | 0

Réponse apportée
Need to fit a curve to some data points
x = [1 2 100]; y = [55 22 0]; ylog=log(y+eps); p=polyfit(x,ylog,2); f=@(x) exp(polyval(p,x)); %The fitted function ...

plus de 2 ans il y a | 0

Réponse apportée
Need to fit a curve to some data points
This uses the fminspleas downloadable, x = [1 2 100]; y = [55 22 0]; flist={@(p,x)1./(x-p(1)).^p(2)}; [p,A]=fminspleas(f...

plus de 2 ans il y a | 0

Réponse apportée
Discretizing a column array, and performing operations on elements of another column array of the same length that lie in the same bins as the original one
G=findgroups( discretize(Z,edges) ); Fbinned = splitapply(@(z) mean(z,1) , F, G);

plus de 2 ans il y a | 0

Réponse apportée
How to restrict tensorprod (with contraction) to only give certain results?
No, you cannot. pagemtimes is the appropriate solution.

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
different results with fmincon
function [c,ceq] = nonlcon(x,B,v) [~,difference]=fun(x,B,v); c=max(difference)-0.001; ceq=[]; end

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Transform coordinates into pixel
Use getframe and writeVideo like in this example: https://www.mathworks.com/help/matlab/ref/videowriter.writevideo.html#mw_6dab...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Extracting tables within a cell.
when try to run a loop to extract these elements and have them written out the loop isn't going past the first cell and only re...

plus de 2 ans il y a | 0

Question


Why don't getframe RGB codes agree with plotted polyshape RGB codes?
In the code below, I have computed the RGB color code of the square as seen in both a polyshape plot (polyshapeRGB) and as seen ...

plus de 2 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
Locate two neighboring nodes in space so as to divide the matrix into two
load xydata xy %Original 3D data mapped to 2D xy=xy(tspsearch(xy,5),:); %tspsearch is on the file exchange P=polyshape(xy,...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Loading multiple structure from a folder
It is because not all of the sub-structures mydata(n).data have the same fields. If you contest that, attach the mydata variable...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Can a ROI shape (ie. a Rectangle made by drawRectangle()) be a property of a class?
You need to specify the complete class name: classdef device properties tag string shape images.ro...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to create struct from fieldnames and values cell arrays for code generation ?
Does it support transpose for normal arrays? If so, then you might be able to do, list_fields = {'a'; 'b'; 'c'; 'd'}; % the fu...

plus de 2 ans il y a | 0

Réponse apportée
Four-parameters optimization of a 1D function: wrong values
I would recommend using fminspleas, https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas with INLP=[p2,p3,p4...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Solve for A matrix in Ax = 0
n=numel(x); mask=tril(triu(ones(n),-1),+1); %tridiagonal mask A=optimvar('A',[n,n]); prob = eqnproblem; prob.Equation...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
negative value structural similarity index
A negative SSIM value means the values in those regions tend to be negatively correlated. When X goes low, then Y tends to go hi...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to handle imagedatastore when input and response have different dimension?
Modify the trntf_input, trntf_label datastores' ReadFcn so that when it reads in the image, it wraps it in a 1x1 cell array. S...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to plot 3D plane of surface with 3 coordinates data?
You can use planarFit, from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools...

plus de 2 ans il y a | 1

| A accepté

Charger plus