Answered
Subtracting two derivatives then store in a new function
Another possibility - numeric differntiation and integration. xFun = @(x,y) 3.*x.*y; dxFun = dfunx(xFun); yFun = @(x,y...

4 years ago | 0

Answered
Subtracting two derivatives then store in a new function
Another possibility- symbolic differntiation then symbolic integration: syms x y r theta xFun = 3.*x*y; dx = diff(xFun,...

4 years ago | 0

Answered
Subtracting two derivatives then store in a new function
One possibility - symbolic differntiation then numeric integration: syms x y r theta xFun = 3.*x*y; dx = diff(xFun,x); ...

4 years ago | 0

Answered
Improvement the speed of array filling
Furthermore , I have tried initializing X as a gpuArray() without any improvement. There should be some improvement. If there i...

4 years ago | 0

| accepted

Answered
How can I realize the 'ArrayValued' option in my customized function?
Use arrayfun.

4 years ago | 0

| accepted

Answered
imref2d error: Array indices must be positive integers or logical values.
You have hidden the size() command by creating avariable called "size". size = mean(brightradii)

4 years ago | 1

Answered
Creating string variables and paths to a directory
See fullfile.

4 years ago | 0

Answered
Bisection method while loop help
while (b-a)>tol

4 years ago | 0

| accepted

Answered
Running n instances of the same function simultaneously
You can use parfeval, assuming you have the Parallel Computing Toolbox.

4 years ago | 0

Answered
Split matrix into N Equal Parts by rows
If N is a multiple of 3, you can download blkReshape, https://www.mathworks.com/matlabcentral/fileexchange/115340-block-transpo...

4 years ago | 0

| accepted

Answered
Axes box incompletely copied to clipboard
export_fig from the File Exchange seems to be able to copy the figure gracefully to the clipboard. imagesc(ones);hax=gca; set(...

4 years ago | 0

Answered
Solving overdetermined linear sytem for possible solutions
Download minL1intlin, https://www.mathworks.com/matlabcentral/fileexchange/52795-constrained-minimum-l1-norm-solutions-of-linea...

4 years ago | 0

Answered
Create a random vector only with positive numbers
If you don't care what the distribution is, infinite possible recommendations can be made. You can use a classically non-negativ...

4 years ago | 0

| accepted

Question


Axes box incompletely copied to clipboard
I am trying to put a red box around an image, like the following, and then copy/paste into a PowerPoint file. imagesc(ones);hax...

4 years ago | 2 answers | 0

2

answers

Answered
How to compare 2 matrices and produce a 3rd matrix of percentage similarity?
Perhaps with xcorr2 or normxcorr2? X=rand(3); Y=rand(3); C=normxcorr2(X,Y); C=C(2:end-1,2:end-1)

4 years ago | 1

| accepted

Answered
Fitting uneven data to a function
Or do I need to use a different function altogether? The first thing I notice is that your model is over-parametrized. You are ...

4 years ago | 0

Answered
Trying to print out values in array that are greater than or equal all elements in rows and less than or equal all elements in colums
Easier: [I,J]=find(M==max(M,[],2) & M==min(M,[],1)); indices=[I,J]

4 years ago | 0

| accepted

Answered
finding mean in 3D cell array
If you download mat2tiles, it is simply, C=mat2tiles( mean(cell2mat(B),1) ,[1,4])

4 years ago | 0

| accepted

Answered
Is there anything faster than the below specified Matlab structure?
This would be slightly better, target.posterior = @fun_1; target.inargs = {y1,y2}; but you are down in the weeds. None of th...

4 years ago | 0

| accepted

Answered
Error Using Plot: Vectors Must Be The Same Length
Check the lengths of the variables you are plotting: whos variable2 variable3 P1 F1 There is no gaurantee that I can see, base...

4 years ago | 0

Answered
How to plot two curves (created from curve fitting toolbox) on the same graph?
You don't have to export code. You could just export the final fit objects fit1 and fit2, using "Export to Workspace", ...

4 years ago | 1

Answered
Selection of subsets from two arrays to an array consisting only of unique values
In practice it is n = 6 and m = 2, however the aim is to maximize the group count and averaging the performance of the groups, a...

4 years ago | 0

Answered
Can you save and append to a variable that is a vector in a matfile
if ~isempty(who(matFileObj, 'var')) matFileObj.var = [matFileObj.var ,var]; end or, if ~isempty(who(matFileObj, 'var'))...

4 years ago | 0

| accepted

Answered
Parallel rank calculation for sparse matrices -- suggestions?
Is the matrix square or is it tall and thin? If the later, then it may be an easier computation to compute rank(A.'*A).

4 years ago | 0

Answered
How to draw unit normal vector?
Once you've plotted the sphere and plane, then with [nx,ny,nz] as the unit normal, hold on quiver3(x0,y0,z0, nx,ny,nz); hold ...

4 years ago | 0

Answered
How to draw unit normal vector?
Does the normal vector have to look like an arrow? If not, then with [nx,ny,nz] as the unit normal, you could do, line([x0,x0+n...

4 years ago | 0

Answered
Which vectors we can use to form a basis of the given space
One solution is to use orth: A = [1,0,2,3; 4,-1,0,2; 0,-1,-8,-10]; basis=orth(A)

4 years ago | 1

| accepted

Answered
How do I get the average of every n rows for every column in a matrix?
Mat1= [1 2 3; 4 5 6 ; 7 8 9; 10 11 12], [m,n]=size(Mat1); rows=2; SOL=reshape(Mat1, rows,1,[]); SOL=mean(SOL,1,'omitnan');...

4 years ago | 1

Answered
Reduce the length of the vector
when i checked the dot( N-O1, A1-O1) or dot( N-O1, B1-O1) were nonzero. You should be checking dot( N, A1-O1) B1=[2.91, 8.05...

4 years ago | 0

| accepted

Answered
Is there a special Matlab function existing to check feasibility of a Point (to a Optimization Problem)
If your problem is already in solver-based form (as is the case in your example), I wouldn't bother with infeasibility. I would ...

4 years ago | 0

| accepted

Load more