回答済み
Sum(sum()) with optimization variable
What about this: L = reshape(1:size(x,3),1,1,[]) b = L >= t-pt_rj & L <= t; Constraint2 = sum(sum(b.*x,3),1) <= ones(1,size(...

4年弱 前 | 0

回答済み
Optimization: Reuse calculations from objective function in nonlinear constraints function
You can use this design pattern function preciousvalue = expensivereuse(inputs) persistent lastresult if ~isempty(lastresult)...

4年弱 前 | 1

回答済み
How to compare values in respective columns using "ismember"
use ismember on each column separately for j=1:size(A,2) A(:,j) = ismember(A(:,j),B(:,j)); end

4年弱 前 | 1

| 採用済み

回答済み
Intersection of two curves
Intersection of to things that are not comparable? why not? just avoid using it to conclude anything that matters. N = [1 2 3 4...

4年弱 前 | 1

| 採用済み

回答済み
Is it possible to specify the 'order' of a smoothing spline?
See if this can helps you https://www.mathworks.com/matlabcentral/fileexchange/25872-free-knot-spline-approximation

4年弱 前 | 0

| 採用済み

回答済み
Matlab Extracting X and Y coordinates
See here

4年弱 前 | 0

回答済み
Natural Cubic Spline Interpolation
You made at least 2 mistakes: h is not computes Typo "x" instead of "X" The rest of the algorithm I didn't look at carefully ...

4年弱 前 | 0

回答済み
Finding a propriate function to fit "U" curve
This is the best I come up with using BSFK FEX x=[0.17 0.33 0.83 1.67 2.5 3.33 5]; y=[6.62466 5.58235 4.63169 5.08213 5.4159 5...

4年弱 前 | 0

回答済み
linprog ignores options, why?
Can you run with exitflag and output [x, fval, exitflag, output] = linprog( c, A, b, [], [], [], [], options ) and share them...

4年弱 前 | 1

| 採用済み

回答済み
Why does MATLAB differentiate between strings and character array data types?
strings is introduced recently and the behavior is not the same than char array, an historic class. So they create a new class t...

4年弱 前 | 0

回答済み
Supplying gradient for the subset of parameters
May be you could provide the gradient interface for all, but compute the subset derivative analytically and the complement by fi...

4年弱 前 | 1

回答済み
Matrix algebra AxB=C, I want to solve for B
You can't recover the "original" B, whatever it is, your system is underdetermined (much more unknowns - 1826 - than equations -...

4年弱 前 | 1

回答済み
How can I assign zeros to a particular value in an expression
test function test N =4; u = (1:N); v = (N:2*N-2); function ui = getu(i) if i <= 0 | i >= 4 ui = 0; else ui =...

4年弱 前 | 0

| 採用済み

回答済み
How to find x value for a known y in array plot?
* x = linspace(-3,3); Assuming your data are monotonic on the neighborhood of the max y = exp(-x.^2); [maxy, imax] = max(y...

4年弱 前 | 0

回答済み
pause() function is inaccurate
The accuracy is documented. "The accuracy of the pause function is subject to the scheduling resolution of your operating syste...

4年弱 前 | 1

回答済み
Question about the fminsearch Algorithm
fminsearch is an mfile, you can copy it then mofify these lines #196 (R2022a) % Set up a simplex near the initial guess. % PUT...

4年弱 前 | 0

回答済み
How to reduce the usage of "broadcast variables" when using parfor
You can use parallel constant to convert el, el_row1, ds, vmin to constant and reduce the data transfert, if they are not modifi...

4年弱 前 | 1

回答済み
Concatenate arrays of different length inside loop
What's wrong with cell? vox_count_cell = cell(1, length(image_files)); for i = 1:length(image_files) header = spm_vol(ima...

4年弱 前 | 0

回答済み
How do I implement multistart with lsqnonlin in my code?
"it returns the initial value" It indicates that the fit fails, not problem of wrong stating points (converge to local minima)....

4年弱 前 | 0

回答済み
solve equation numerically 1=(1/y)x*exp(x*y)
Numercial solution y = 0.01:0.01:1; x = nan(size(y)); for k=1:length(y) yk = y(k); x(k) = fzero(@(x)x.*exp(x.*yk)-y...

4年弱 前 | 0

| 採用済み

回答済み
How can I find negative factorial ? (-0.5)!
There are actually different ways of extending factorial function, see here http://www.luschny.de/math/factorial/hadamard/Hadam...

4年弱 前 | 1

回答済み
install standalone application on macOs, that was compiled on windows
" According to Matlab, I think it should be possible ( https://de.mathworks.com/help/compiler/install-deployed-application.html ...

4年弱 前 | 0

回答済み
Remove all rows of an array based on a value in a column, and also remove all rows that have the same values as this row in other columns
M = [ 15.88 18.43 15.88 18.43 0 15.88 18.43 33.48 14.99 ...

4年弱 前 | 0

| 採用済み

回答済み
why is acumarray much slower calculating means than sum?
The default behavior of accumarray is sum and it's low-level coded. When you pass user-defined function MATLAB will call the fu...

4年弱 前 | 2

| 採用済み

質問


reduction variables and evaluation order
This the doc on can read "A reduction variable accumulates a value that depends on all the iterations together, but is independ...

4年弱 前 | 1 件の回答 | 1

1

回答

回答済み
Adding fields to a struct?
[PR1Data.filename] = deal(''); or if you PR1Data is non empty PR1Data(1).filename = '';

4年弱 前 | 1

| 採用済み

回答済み
Faster way to create a matrix of the unique() of each row of a matrix
% Test example A=randi(4,10,5) [m,n] = size(A); As=sort(A,2); b=[true(m,1),diff(As,1,2)>0]; R=repmat((1:m)',1,n); C=cums...

4年弱 前 | 1

| 採用済み

回答済み
How to create 3D matrix with empty cells
cell(3,3,3) % replace 3 with 300 for you I'm still afraid you'll be soon in trouble if you ask such question about easy data cr...

4年弱 前 | 0

| 採用済み

回答済み
Fit coefficients are equal (to starting points) in 3000 different fits
Can you do check whereas they are identical with this command after the loop isequal(Coefficients(:,10),Coefficients(:,2999)) ...

4年弱 前 | 0

| 採用済み

さらに読み込む