Answered
Trying to get a function to apply to values in an array
One way to fix it, V=arrayfun(@(z)tank(10,z), d);

6 years ago | 1

| accepted

Answered
cftool and hyperdimensional data
It cannot, but lsqcurvefit can. https://www.mathworks.com/help/optim/ug/lsqcurvefit.html

6 years ago | 1

| accepted

Answered
How to Use "Ask a Question" Section Correctly?
Clearing cookies was sufficient for me.

6 years ago | 0

Question


Using CUDA mex files interoperably with gpuArray
I have a 3rd party black box CUDA mex file. Every time I use it, it puts my GPU in a state such that gpuArray cannot subsequentl...

6 years ago | 1 answer | 3

1

answer

Answered
How do I remove any Column in a matrix
Nothing is wrong with the code you've posted, but it would be simpler to do, B=A(:,[1:n-1,n+1:end]); or, slightly less effici...

6 years ago | 2

| accepted

Answered
How to convert a cell containing sub cells to a vector
A={{{rand(5,1)},{rand(7,1)}},{rand(3,1)}}; %Example Vector=A; while iscell(Vector) Vector=cellfun(@(c) c(:), Ve...

6 years ago | 0

| accepted

Answered
How does vectorized lsqcurvefit() calculate sum-of-square, row-wise or column-wise?
if ydata is m-by-n, then sum-of-squares should be m-by-1. No. The objective function minimized by lsqcurvefit is always just, ...

6 years ago | 1

| accepted

Answered
Column multiplication of two 2D matrices.
I am planning to take sum along the third dimension That would simply give you A*B.'

6 years ago | 1

Answered
Column multiplication of two 2D matrices.
I doubt you will be able to do the computation with the matrix sizes you've indicated. The result will consume 3.5 TB of RAM in ...

6 years ago | 0

Answered
multiple loop do not loop
for i=1:noofcol for j=1:noofrow

6 years ago | 0

| accepted

Answered
Rearranging a 512x64 matrix into a 32x1024 matrix
See reshape(). https://www.mathworks.com/help/matlab/ref/reshape.html

6 years ago | 0

Answered
Variance when only one observation is not NaN
A=myTable.A; pastvarofA=movvar(A,[4,0],'omitnan'); pastNaNs=movsum(~isnan(A),[4,0],'omitnan'); pastvarofA(pastNaNs<=1)=na...

6 years ago | 0

| accepted

Answered
Performance of Parfor Loops
Because even when you use just 1 worker, the Matlab code will to some degree be able to use all 8 cores that you have. To see if...

6 years ago | 0

| accepted

Answered
EDITED: Variance when only one observation is not NaN
A=[1;2;3;NaN;5;5;6]; varofA = movvar(A,2,'Endpoints','discard')

6 years ago | 0

| accepted

Answered
Obtaining min value each month across several years
G=findgroups(filename(:,3),filename(:,4)); [mintemp,rowIndex]=splitapply(@func,filename(:,1),(1:numel(G)).',G) functio...

6 years ago | 0

| accepted

Answered
Problems running gpuArray function - CUDA driver
Make sure you've rebooted the computer after the installation.

6 years ago | 0

Answered
Optimization objective funcion containing a sum
s=sign(sum(PV(1:n,1))); if s<=0, b=1; else, b=0; end

6 years ago | 0

Answered
Optimization function with a summation
The solution is simply, b = zeros(144,5); b(PV(1:j)>0,:)=1;

6 years ago | 0

Answered
optimization using problem based
Are you sure t should be an optimvar? It seems to me it should be a set of discrete known values t = linspace(0,Time,N) Once...

6 years ago | 0

Answered
Error in fminsearch (line 200) fv(:,1) = funfcn(x,varargin{:});
Change the output of your function to a squared error over all 3 companies, or some other scalarization of the current output th...

6 years ago | 0

Answered
If I already had a function and some points(x,y), how can I find six parameters in a function?
fminspleas would be a good choice, https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas seeing as 3 of your ...

6 years ago | 1

Answered
Find the symmetric and skew-symmetric matrices by 2x2 blocks
A=[ 0,-1, 2,3; 1,0, 4,2; -2,3, 0,-1; 4,-2, 1,0; ]; n=length(A)/2; mask = (-1).^( (1:2*n).' ...

6 years ago | 0

Answered
Has MATLAB implemented a polygon offset function?
Sounds like you could do that with polybuffer https://www.mathworks.com/help/matlab/ref/polyshape.polybuffer.html and polyshap...

6 years ago | 1

Answered
How to get fminimax work for both max and min objectives?
Using Sion's minimax theorem, the min and the max can be interchanged to give a much simpler problem, The solution to t...

6 years ago | 0

Answered
How to fit rectangles on blobs on binary image
regionprops(BW, 'BoundingBox')

6 years ago | 0

Answered
How to get fminimax work for both max and min objectives?
You could reformulate the problem as follows and solve the whole thing with fmincon. No non-differentiable minimizations require...

6 years ago | 1

Answered
How can I create a cell that splits a sequence of numbers (1 : n) in equal parts?
Using mat2tiles, https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into-equal-sized-sub-arrays ...

6 years ago | 1

| accepted

Answered
How can I fit data to a system of implicit equations?
See lsqnonlin, https://www.mathworks.com/help/optim/ug/lsqnonlin.html?searchHighlight=lsqnonlin&s_tid=srchtitle

6 years ago | 0

Answered
3D array of indices of a 4D array
It should be sufficient just to do maskTime=logical(maskedTime); maskedVolume=V.*maskTime; or possibly you were looking fo...

6 years ago | 0

Answered
How to get fminimax work for both max and min objectives?
For C>=1 (EDIT), your problem can be rewritten so you should just follow the fminimax documentation with

6 years ago | 0

Load more