回答済み
Combine three matrices (every other column)
rfun = @(x) reshape(x,[1 size(x)]); D = reshape([rfun(A);rfun(B);rfun(C)],[],size(A,2)) The second method looks shorter but it...

7年弱 前 | 0

回答済み
Expected one output from a curly brace or dot indexing expression, but there were 2 results.
In general you are not allow to assign multi-level structures with non-scalar indexing in one shot, you need to do in 2 steps. ...

7年弱 前 | 2

| 採用済み

回答済み
How to properly convert variable names into a chain of strings in Matlab?
a = 1; b = 2; savevars('myfile.mat', a,b); function savevars(file, varargin) v = varargin; f = cell(size(v)); for k=1:le...

7年弱 前 | 0

回答済み
How to properly convert variable names into a chain of strings in Matlab?
If you use number in variable name then you'll run into trouble soon or later. Just don't do it. Not sure the advantage of usi...

7年弱 前 | 1

| 採用済み

回答済み
How to remove data from a real-time plot after a certain period of time?
Have you seen the 'MaximumNumPoints' option of animatedline()?

約7年 前 | 1

| 採用済み

回答済み
Finding cube with most Values
This FEX might help

約7年 前 | 0

回答済み
Modifying a structure array
S=struct; S(1).f1=5*[2,3,4,5,6,7,8,10,14,16,18,20]; S(1).f2=5*[3,6,9,12,15,18,21,24,27,30,33,36]; S(2).f1=40:120;S(2).f2=60:1...

約7年 前 | 1

| 採用済み

回答済み
Scaling of vectorized code which is limited by memory access
Here is my C-mex implementation, on my laptop it accelerates by 20 fold from your original MATLAB code (compiled with MSVS 2017,...

約7年 前 | 1

| 採用済み

回答済み
Determining values in array (of 1s and 0s) that neighbour similar values
If you have Image Processing tbx you might take a look at imerode

約7年 前 | 1

回答済み
Need to Split a column of type 'string' in a Table in to group of 4 characters giving new names to the result.
s=[ "65 00 69 00 6D 00 75 00 "; "B7 FF E5 FF 7D 10 01 00 "] c = char(s); c(:,3:3:end)=[]; ssplit = string(mat2cell(c,...

約7年 前 | 1

| 採用済み

回答済み
How to convert matrix to cell array?
c = mat2cell(A,4,4*ones(1,35)) If you want nested cell as well, do that after the above c = cellfun(@num2cell, c, 'unif', 0) ...

約7年 前 | 0

| 採用済み

回答済み
avoid for loop in a specific code
predicted_target = {'1'; '0'; '0'; '1'}; Target = {'0'; '1'; '1'; '1'}; prefix = {'E'; 'c'} new_classes = strcat(prefix(str...

約7年 前 | 0

| 採用済み

回答済み
could anyone help me to solve the issue
Ypu can use assignment optimal problem to solve it, one implementation is in FEX Munkres algorithm A=[ 0 0 ...

約7年 前 | 0

回答済み
change entry of sparse matrix
Change it exactly like regular (non-sparse) matrix: A(sub2ind(size(A), inx, inx)) = out

約7年 前 | 0

| 採用済み

回答済み
mex crash with fftw calls
I can't remember having issues using FFTW with MATLAB. I use on Windows platform and I'm sure my code work for R2015a up to R201...

約7年 前 | 0

回答済み
Fit data to part of an ellipse
Arbitrary oriented elllipse in this thread If you want ellipse aligned with x/y you need to remove the cross term xc.*yc (or fo...

約7年 前 | 0

回答済み
What's the best way to check if a system of one equation and one inequality has any solution?
In your case use first Euler-Lagrange condition gives one solution if it exists meaning find lambda, x, y, st [2*x/25, 2*y/25]...

約7年 前 | 0

回答済み
Best File Exchange ever !!!
I give my vote for https://fr.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multiply-with-multi-dimensiona...

約7年 前 | 0

回答済み
How to perform piece-wise linear regression to determine break point?
Another tool is my FEX BSFK load('Sample2.mat') BSFK(Sample2(:,1),Sample2(:,2),2,[],[],struct('annimation',1)); ans = ...

約7年 前 | 0

回答済み
arrayfun isreal fails - how to fix?
Guys ISREAL tests whereas the internal storage of an array does not allocated memory for the imaginary part, it is NOT testing t...

約7年 前 | 0

回答済み
Circle least squares fit for 3D data
X=csvread('data.csv'); XC = mean(X,1); Y=X-XC; [~,~,V]=svd(Y,0); Q = V(:,[1 2]); % basis of the plane Y=Y*Q; xc=Y(:,...

約7年 前 | 5

| 採用済み

回答済み
Fseminf can't be used if the constraints' dimsion is higher than 2?
If you have one inequality (doesn't matter how the lhs is computed, with finite or infinite series or products), then you have O...

約7年 前 | 0

回答済み
Indexing numbers for 2 or more specific values in a vector?
h = find(vec==26 | vec==437) or h = find(ismember(vec,[27 437]))

約7年 前 | 1

| 採用済み

回答済み
Fast multiplication: binary matrix with double matrix
Here is two ways, it won't be faster than A*B as other has warned you n = 512; A = sprand(n,n,0.1) > 0 ; B = rand(n,n); m ...

約7年 前 | 0

回答済み
Return all possible Cuts of array A If you have defined number of parts M
Code for your latest request of overlap outputs. A = [1 2 3 4] cuts = 2 N = length(A); c = nchoosek(1:N-1+cuts,cuts)-(1:cu...

約7年 前 | 1

回答済み
Return all possible Cuts of array A If you have defined number of parts M
A=[1 2 3 4 5 6] M = 2; N = length(A); C=nchoosek(1:N-1,M); n=size(C,1); C=[zeros(n,1), C, length(A)+zeros(n,1)]; m=diff(...

約7年 前 | 1

回答済み
Unfold 3D I x J x K to 2D I x JK
X=M(:,:)

約7年 前 | 0

回答済み
linear optimization using optimization toolbox and minimize array sum
Diff= abs(D-TH); Now I want to minimize the sum of "Diff" Threshold = median(D)

約7年 前 | 0

回答済み
How to generate all collections of n subsets of 1:v?
v = 2; n = 3; B = 1:2^v-1; c = repmat({B},1,n); [c{:}] = ndgrid(c{:}); c = cat(n+1,c{:}); c = reshape(c,[],n); B = arrayf...

約7年 前 | 0

質問


Warning on PERSISTENT statement
I know that PERSISTENT statement is slow, and try to overcome by passing an logical argument to by-pass when I know the function...

約7年 前 | 0 件の回答 | 0

0

回答

さらに読み込む