Answered
Why the optimization results of lsqnonlin are different in R2026a and R2025a?
There appears to be a new (and buggy) implementation of expm.m in R2026a, resulting in incorrectly complex results for skew sym...

1 month ago | 1

| accepted

Answered
Quick substitution of all multi-objective optimization results (gamultiobj) into optimization expressions
Obviously I can build a loop over ii to get an array Mval, but is there a way to do it more elegantly? Doesn't seem it like it....

1 month ago | 0

Answered
Why is xlim not working?
Calling axis equal triggers an xlim,ylim adjustment. % Set parameters for main circle center = [3,6]; radius = 2; angleStart...

1 month ago | 1

| accepted

Submitted


A class for successive matrix products
A class representing products of matrices, internally storing/manipulating them separately.

1 month ago | 2 downloads |

0.0 / 5

Answered
How to define size of class property depending on a given parameter (including codegen)
With the classdef below, you can set the default size with its defaultSize() static method. This will remain in effect until the...

1 month ago | 1

Answered
"help" does not work
Possibly help.m is calling a function which you have shadowed. You will probably have to use dbstep to track this, or the equiva...

1 month ago | 1

| accepted

Answered
App Designer: How can I use an index to increment a Value field such as editfield1.value, editfield2.value, editfield3.value, etc.?
It would be better to use a uitable for this, or at least to use numeric EditFields instead of textual EditFields. Regardless, ...

1 month ago | 0

| accepted

Answered
how to upscale the dimensions of a matrix to match the dimensions for a second matrix?
Use imresize load Carbon load Rain rainResized = imresize(rain, OutputSize=size(bc_aod)); tiledlayout('h') nexttile im...

1 month ago | 0

| accepted

Answered
rmpath does not remove folders on path
No, as you have been warned "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" is not on your Matlab path....

1 month ago | 0

| accepted

Answered
Discrepancy in sparse matrix math, when NaN's present
The response I seem to be getting from Tech Support is that this is expected behavior. NaNs are not guaranteed to propagate the ...

1 month ago | 0

| accepted

Answered
Numerical Integrators With Problem-Based Optimization
but quickly realized that the class of variables used in the problem-based approach will not work with ode45 (or any root-findin...

1 month ago | 1

| accepted

Question


Discrepancy in sparse matrix math, when NaN's present
I expect result1 and result2 below to be identical, but they aren't. The discrepancy must be a bug, right? I'm working in R2024b...

1 month ago | 1 answer | 0

1

answer

Answered
Create a 2D image based on what a camera would see
You could just do a surface plot of the object, set the camera position parameters of the axes, and then use exportgraphics (whi...

2 months ago | 0

Answered
Assigning different data types to struct arrays using comma separated list assignment. Are there better options?
I like the performance of the code, however, I find it more difficult to read than for-loops Why not just use for-loops then, i...

2 months ago | 0

| accepted

Answered
I am getting the following error
There are many ways to generate that error. One of them is that you may be using 'end' as the name of a variable, e.g., end=1

2 months ago | 0

Answered
How to extract a specific frame from a video based on user input?
This example looks applicable to you: Read Video Frames Starting at Specific Time.

2 months ago | 0

Answered
Why do Nan values greatly increase the cost of sparse multiplication
I think you should report it as a bug. If you need a workaround, though, the following equivalent operation, which avoids implic...

2 months ago | 0

| accepted

Answered
How can I execute a function if it exist, otherwise use a custom function?
Have the used append (i.e., not prepend) your knnsearch to the path. If a native knnsearch exists above it in the path, it will ...

2 months ago | 0

| accepted

Answered
how to create a volume from the revolution of a variable area trapezoid
Here's a little bit more of a polished version of my original answer, which also generates a movie of the trapezoidal cross-sect...

2 months ago | 3

Answered
how to create a volume from the revolution of a variable area trapezoid
Along the lines of what @Mathieu NOE commented, I think it does make more sense to start with an elliptic cylinder and clip off ...

2 months ago | 3

Answered
Efficiently assign data into a struct?
You can replace all occurences of '1:end' with ':' and condense your indexing operations. This, for example, T1.var4.y = zer...

2 months ago | 0

Answered
How to multiply different size arrays and multiply each element by each element?
Download ndgridVecs from the File Exhange, https://www.mathworks.com/matlabcentral/fileexchange/74956-ndgridvecs?s_tid=srchtitl...

2 months ago | 0

Answered
Error using trainnet (line 46)
It appears that if your XTrain is in cell array form, you need to put your TTrain data in cell form as well: load('attachedData...

2 months ago | 1

| accepted

Answered
Indexing a 4-D array using a logical matrix
Assuming you are trying to extract the polygon interiors, you could do, [~,~,p,q]=size(map); Map=reshape(map,[],p*q); tes...

2 months ago | 0

| accepted

Answered
What is the difference between different ways to do least square
The train_100 system is underdetermined, so of course you aren't going to get a unique solution. For the 5k data, the only rea...

2 months ago | 1

| accepted

Answered
How to change the ratio of sectors for a circle with 8 equal sectors
One possibility: dTheta=360/8; %sector angle t=linspace(0,dTheta)'; sector=polyshape([0,0;cosd(t),sind(t)]); circle=array...

2 months ago | 0

| accepted

Answered
How to convert trajectory of the current vector to grayscale.
Maybe this is what you wanted? load("data.mat") Ia = data(:,1); Ib = data(:,2); Ic = data(:,3); %% Clarke (3 phase → αβ...

2 months ago | 1

| accepted

Answered
optimization optimplot capture frame
optimplot does not plot in a figure container of the type that you can get a handle to. Prior to R2025, you could probably have...

2 months ago | 0

| accepted

Answered
Preconditioning in fmincon
EDIT: You cannot pass a preconditioner on its own, nor would you want to if the true Hessian can be computed. However, using eit...

2 months ago | 0

Answered
How can I fit data to a piecewise function, where the breakpoint of the function is also a parameter to be optimised?
Why ? Both parabola can intersect below their respective maxima, and nonetheless the point of intersection can be the maximum y-...

2 months ago | 0

Load more