Answered
How to avoid linear indexing in operations involving matrices of different sizes
A = rand(3,3); B = rand(3,2); idx = logical([0 1 1; 0 1 1; 0 1 1]); C=B; C(:)=A(idx)+B(:)

3 years ago | 0

Question


Deep Learning Toolbox class hierarchy
I am looking for some kind of condensed overview of the Deep Learning Toolbox class hierarchy. There are many types of network o...

3 years ago | 1 answer | 0

1

answer

Answered
fmincon: any way to enforce linear inequality constraints at intermediate iterations?
Within your objective function, check if the linear inequalites are satsfied. If they are not, abort the function and return Inf...

3 years ago | 0

Answered
fmincon: any way to enforce linear inequality constraints at intermediate iterations?
Within your objective function, project the current x onto the constrained region using quadprog, fun=@(x) myObjective(x, A_i...

3 years ago | 0

| accepted

Answered
Efficient sum along block diagonals
I believe this works! If you want to put this into a separate answer I will vote for this! I'm glad, but if it does work, pleas...

3 years ago | 0

| accepted

Answered
Matrix / image rotation
Rotate the z data only. load test.mat phi = 45; z_r=imrotate(z,-phi,'crop'); map=~imrotate(~isnan(z),-phi,'crop'); z_...

3 years ago | 0

| accepted

Answered
How to index a matrix other than using curly brackets
Why not stack the T1x{i} into a 3D array, T1x=cat(3, T1x{:}); Indexing them would look like, T1x(:,:,i) and summing over i c...

3 years ago | 0

| accepted

Answered
Efficient sum along block diagonals
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/115340-block-transposition-permutation-and-reshap...

3 years ago | 0

Answered
GPU out of memory issue appears with trainNetwork.
Then I tried a larger input data set, but get the out of memory error: If you make your data larger and larger, you will eventu...

3 years ago | 0

| accepted

Answered
Fitting PDE with lsqcurvefit with only part of the data
Can't you just modify your model function so that it solves the PDE over [0,20], but then discards solutioin points from [0,2.5]...

3 years ago | 0

Answered
How to use fread with sizeA involving 3D arrays?
One way: Data = fread(fid, [rows,inf], 'uint32', 'l'); Data=reshape(Data,rows,cols,[]);

3 years ago | 0

| accepted

Answered
lsqcurvefit with 2 points trouble
Change the units of your xdata to something more natural: xdata2 = (2e-5:2e-5:18e-5)*1e5; and then, ydata2 = [0.997 0.991...

3 years ago | 0

Answered
Generalized equation using multiple equation
[Hint: When Z = 0 I will get black curve; When Z = 0.5 I will get blue curve; When Z = 1 I will get red curve; When Z = 2 I will...

3 years ago | 0

Answered
Blocked images larger than a certain size will not render in Image Labeler
One other possible workaround is to convert the image to grayscale, e.g., using the ReadFcn property of the imageDataStore, for ...

3 years ago | 0

Answered
Sort coordinates in two directions at the same time
load data_coordinates tf=~isnan(x)&~isnan(y); [x,y]=deal(x(tf),y(tf)); [~,t]=sort( [lon-x(1),lat-y(1)]*[x(end)-x(1);y(e...

3 years ago | 0

| accepted

Answered
How can I plot a cube with different images projected on each face?
This looks like it will do what you describe: https://www.mathworks.com/matlabcentral/fileexchange/28581-imsurf-3d-images?s_tid...

3 years ago | 0

| accepted

Answered
Why do I receive the error message "sliceViewer requires 3-D grayscale(MxNxP) or 3-D RGB volume(MxNxPx3) with no singleton dimensions"?
I see nothing in your code that would be expected to access the numeric content of the DICOM files. You should probably be using...

3 years ago | 0

| accepted

Answered
Sort coordinates in two directions at the same time
It's not possible to sort so that the Nx2 matrix [lat(:),lon(:)] increases monotonically in both columns simultaneously, but yo...

3 years ago | 0

Answered
,v1Trying to solve a linear equation matrix with a log of X1-X5 in the matrix. Not sure how to use the log value in simulate to get correct result.
Make the change of variables z(i)=log(X(i)). Then use lsqminnorm to solve the linear equations in v(i) and z(i). You can then ex...

3 years ago | 0

Answered
Blocked images larger than a certain size will not render in Image Labeler
my understanding has been that it automatically sets the block size based on the size of the image and maybe the zoom level Per...

3 years ago | 0

Answered
calling unique function on a string column of a table failed
Why not as in the example below? T=table(["a";"b"; "a"],'Var',"C") [v,u]=unique(T.C)

3 years ago | 0

| accepted

Answered
trying to plot fminsearch as a polynomial
fplot( @(year) A6(1)* exp(A6(2)* year) + A6(3) )

3 years ago | 0

Answered
Image Processing - Absolute sum of the differences employing a weighted kernel
There are problems with the mathematical formulation, as noted in the comments above. However, for the general task of computing...

3 years ago | 0

| accepted

Answered
Blocked images larger than a certain size will not render in Image Labeler
I could of course break the images up into smaller images but that would make my workflow less efficient Breaking them up for t...

3 years ago | 0

Answered
Generalized equation using multiple equation
You can use lsqcurvefit with model function, xdata = [0.25 0.50 0.75 1 1.25 1.50 1.75 2 2.25 2.50 2.75 3]; y1 = [0.001524 0.0...

3 years ago | 0

| accepted

Answered
intersection between a many plots and a line
You could use linexlines2D from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/93470-intersections-of-...

3 years ago | 0

Answered
using a matrix in a calculation
Use element-wise operators .*, ./, and .^

3 years ago | 0

Answered
Interpolate Nan values in timetable
You could use movmean, like in this example, https://www.mathworks.com/help/matlab/ref/movmean.html#bu6jxup

3 years ago | 0

Answered
Problem: Image segmentation of forest area using CNN and MATLAB's BLOCKPROC function.
I would implement fun as a non-anonymous function. Then, you can stop inside the function and inspect the result: C = blockproc...

3 years ago | 0

Load more