Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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. ...

presque 7 ans il y a | 2

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
How to remove data from a real-time plot after a certain period of time?
Have you seen the 'MaximumNumPoints' option of animatedline()?

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Finding cube with most Values
This FEX might help

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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,...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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

presque 7 ans il y a | 1

Réponse apportée
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,...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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) ...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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 ...

presque 7 ans il y a | 0

Réponse apportée
change entry of sparse matrix
Change it exactly like regular (non-sparse) matrix: A(sub2ind(size(A), inx, inx)) = out

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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]...

presque 7 ans il y a | 0

Réponse apportée
Best File Exchange ever !!!
I give my vote for https://fr.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multiply-with-multi-dimensiona...

presque 7 ans il y a | 0

Réponse apportée
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 = ...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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(:,...

presque 7 ans il y a | 5

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
Indexing numbers for 2 or more specific values in a vector?
h = find(vec==26 | vec==437) or h = find(ismember(vec,[27 437]))

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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 ...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 1

Réponse apportée
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(...

presque 7 ans il y a | 1

Réponse apportée
Unfold 3D I x J x K to 2D I x JK
X=M(:,:)

presque 7 ans il y a | 0

Réponse apportée
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)

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

Question


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...

presque 7 ans il y a | 1 réponse | 0

0

réponse

Charger plus