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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 2

| akzeptiert

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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 1

| akzeptiert

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

etwa 7 Jahre vor | 1

| akzeptiert

Beantwortet
Finding cube with most Values
This FEX might help

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 1

| akzeptiert

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

etwa 7 Jahre vor | 1

| akzeptiert

Beantwortet
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

etwa 7 Jahre vor | 1

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

etwa 7 Jahre vor | 1

| akzeptiert

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

etwa 7 Jahre vor | 0

| akzeptiert

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

etwa 7 Jahre vor | 0

| akzeptiert

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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 0

| akzeptiert

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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 0

Beantwortet
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(:,...

etwa 7 Jahre vor | 5

| akzeptiert

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

etwa 7 Jahre vor | 0

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

etwa 7 Jahre vor | 1

| akzeptiert

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

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 1

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

mehr als 7 Jahre vor | 1

Beantwortet
Unfold 3D I x J x K to 2D I x JK
X=M(:,:)

mehr als 7 Jahre vor | 0

Beantwortet
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)

mehr als 7 Jahre vor | 0

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

mehr als 7 Jahre vor | 0

Frage


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

mehr als 7 Jahre vor | 0 Antworten | 0

0

Antworten

Mehr laden