Réponse apportée
Can I write this in a more compact way?
Cellfun/arrayfun is just disguished for-loop. They are more compact in syntax, less flexible and often slower. Then the proper ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Finding a vector as a subset of an array
[u,~,j] = unique(a(:)); [tf,loc] = ismember(b(:),u); s = [length(u),1]; result = all(accumarray(j(:),1,s) <= accumarray(loc(t...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I convert an array of hex values to a num?
>> xa=dec2hex('0.01') xa = 4×2 char array '30' '2E' '30' '31' >> a=str2double(char(hex2dec(xa))...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Creating all possible binary sequences for specific length under certain constraints
This code works for toy dimension(s), if you take n up to 96 you might have memory issue as people have rightly warned you. n ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to use CROSS with 3x1 Matrix on a 3xN Matrix
For my own use I have written this function %% function c = cross_dim1(a,b) % Calculate cross product along the first dimensi...

plus de 7 ans il y a | 0

Réponse apportée
Diagnose infeasibility of linear programming
"I need to check which constraints can be relaxed to well-define the problem." It likes asking: when a glass of water spills o...

plus de 7 ans il y a | 0

Réponse apportée
How to call vector in matrix with condition
[tf,loc] = ismember(A(:,1),B); r = sortrows([loc(tf),A(tf,4)],1); r(:,2) ans = 20 30 50

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
I need to perform a 3D fourier transform on a large 3D array (10^9 data points), is there anyway I can reduce the memory demands of this process.
You might use SINGLE intead of DOUBLE psi = single(psi); fftpsi = fft(psi,[],3); Next might be working slide by slide, not su...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
How can I find all nodes that should precede node 'Node' from the information contained in a digraph G?
source = [1 1 2 3 4 5 7]; sink = [2 3 5 4 7 4 6]; node = 4 p = FindprecNodes(source, sink, node) function p = FindprecNode...

plus de 7 ans il y a | 1

Réponse apportée
Speeding up Sort Algorithm by removing ismember
time = [ 1 3 2 4 7]; signal= [12 14 11 13 16]; [time, signal] = mysortdata(time, signal) %% function [time, signal] =...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
point cloud with matlab
OP's question "I really want to ask regarding 3D Point cloud. we have points with X, Y, Z. We are totally new at this work. Wit...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Is there any solution to generate an orthogonal matrix for several matrices?
What you ask is the eigen-vectors common for all three matrices. In general no, such system does not exists. I can even show th...

plus de 7 ans il y a | 0

Réponse apportée
Solving a system of linear equations with a few known variables
Assuming known is the logical index == TRUE for indexes of x that are known % known = ismember(1:5,[1 5]) % in your example ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How do I create a function that takes a vector of arbitrary length as an input argument and randomly permutes it as an output argument using the identity matrix, without using the randperm command?
Fisher–Yates shuffle for i = length(A):-1:2 j = ceil(i*rand); A([i,j]) = A([j i]); end

plus de 7 ans il y a | 0

Réponse apportée
point cloud rot in matlab
xyz=xlsread('PointClouds.xlsx',3); % Find the rotation axis xyzc = mean(xyz,1); xyzr = xyz-xyzc; [~,S,V] = svd(xyzr,0); ...

plus de 7 ans il y a | 1

Réponse apportée
How to fit linear plateau equation ?
You can use this FEX file (BSFK) The code is by default use QUADPROG from MATLAB, but can also work with QPAS project by Adri...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Best/fastest way to call MATLAB routine from C repeatedly
You must not do Loading, Init, Close repeatly. They must be called once, then you must call whatever function you want repeatly...

plus de 7 ans il y a | 1

Réponse apportée
Finding the pseudo inverse of a matrix
For non-full rank square matrix A, there exists no matrix B such that A*B = I So the pinv(A) (at the B place) won't make mirac...

plus de 7 ans il y a | 0

Réponse apportée
Why linprog give answer not satify the constrains?
Because you never pass constraints A*x <= b in LINPROG [x, f] = linprog(f,[],[],Aeq,beq,lb,ub,options);

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Finding particular solution to 3x3 matrix using undetermined coefficients
Guys, this is a linear system, why using FSOLVE? >> [-15/4 0 0; 15/4 -5/12 0; 0 5/12 -5/14]\[-1575; 0; 0] ans = ...

plus de 7 ans il y a | 1

Réponse apportée
Sparse matrix in OLS , sparse matrix transpose and multiply
B = Y/X

plus de 7 ans il y a | 1

Réponse apportée
How to use all the other indices except of the ones given in an array?
A(idx) = 0; B(setdiff(1:end,idx)) = 0;

plus de 7 ans il y a | 3

| A accepté

Réponse apportée
Selecting more than one range of elements of a vector with a single line code
a([1:10, 90:100])

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Alternatives to using diff(X,2)
Just apply the same method twice D1 = A(2:end)-A(1:end-1); D2 = D1(2:end)-D1(1:end-1) or D2 = conv(A,[1 -2 1],'valid')

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Why aren't sparse matrices padded with zeros to the highest sizes?
Not specific to sparse, similar such operator on full matrices also returns error. A sparse matrix is designed to be equivalent...

plus de 7 ans il y a | 0

Réponse apportée
I found a mistake in Lasso function
There is no bug, just misunderstanding of OP. N is the number of observations, meaning the number of rows of X and length of y...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Covert matrix to sub-matrices
A = reshape(yourdata, [2035,1476,3]); A = permute(A,[1 3 2]); Now invoking: A(:,:,k) returns kth matrix of size (2035 x 3),...

plus de 7 ans il y a | 0

Réponse apportée
vectorise a row number search
AA = B(A)

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Find matches without repetition from two cell arrays + extra condition
You don't even need the period table, assuming element start with an Uppercase eventually followed by lower-case NameSpecies = ...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
how to find the shortest distance between two lines in R3 ?
No need a big hammer, a simple formula is enough d = abs(null([x1(:)-x0(:),y1(:)-y0(:)]')'*(x1(:)-y1(:))) Or to avoid NULL n ...

plus de 7 ans il y a | 0

| A accepté

Charger plus