Beantwortet
Can I rewrite the following without loops ?
YIQImage = reshape(T*reshape(permute(double(I),[3,1,2]),3,[]),size(I));

mehr als 8 Jahre vor | 0

Beantwortet
Combinations of multiplications of a vector
inp = 1:4; out = yourmultnchoosek(inp) here |yourmultnchoosek| - function: function out = yourmultnchoosek(inp) ...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Any idea on how to build this function?
Let T - your T0,T2 and etc. (T = [T0,T1,...,TN]); f - your f0,f1 and etc. (f = [f0,f1,...fN]). function F = yourfreq(t,T...

mehr als 8 Jahre vor | 0

Beantwortet
How to convert 256x1 cell into 16x16 cell
reshape(YourCell,16,[]);

mehr als 8 Jahre vor | 1

Beantwortet
Dot produkt MxNxL -Array with a L-element vector
m = size(A,1); k = 3; As = reshape(reshape(permute(A(:,:,1:k),[3,1,2]),k,[])'*reshape(B(1:k),[],1),m,[]);

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Unique factorial design or number sequence
v1 = [4 6 8 10 12]; v2 = [1 2 3]; n1 = length(v1); n2 = length(v2); ii = flip(fullfact([n2,n1*ones(1,n1)]),2)...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How to efficiently sort a vector relative to a reference vector
[~,ii] = ismember(RefMat,ToSort(:,1)); relative2REF = ToSort(ii,:);

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
arrenging rows and columns ?
lat = [-90 -60 -30 00 30 60 90]'; long = [ -160 -120 -80 -40 00 40 80 120 160 ]; [x,y] = ndgrid(lat,long); out...

mehr als 8 Jahre vor | 2

Beantwortet
compare two values and chosing the higher one
a = [ -0.1623 -0.5320 -0.8757 -0.7120 -0.1461 1.6821 -0.4838 -1.1742]; out = (a == max(a)).*a; or ...

mehr als 8 Jahre vor | 0

Beantwortet
how use reshape ?
data = [2 5 4 7 8 2 5 8 4 6 1 5 2 5 8 3 6 4 8 4]; [x,y] = ndgrid(1:size(data,1),1:size(data,2)); out = [x...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
How to index function-matrices?
function out = f(x,ii,jj) a = [x,1;1,x]; out = a(ii,jj); end use >> f(1,1,1) ans = 1 >>...

mehr als 8 Jahre vor | 0

Beantwortet
how to add zeros around a matrix?
padarray(A,[1 1],0)

mehr als 8 Jahre vor | 1

Beantwortet
How to find an array within a cell array
out = celltime(cellfun(@(x)iscell(x) & numel(x) > 1 ,celltime));

mehr als 8 Jahre vor | 0

Beantwortet
i have A=[ 1 3 5 7] B=[2 4 6 8] i need to get answer like c=[1 2 3 4 5 6 7 8] pl help me
c = zeros(numel(A) + numel(B),1); c(1:2:end) = A; c(2:2:end) = B;

mehr als 8 Jahre vor | 2

| akzeptiert

Beantwortet
How to use the following nested loop and store values
b = mult(:)' + (1:45)'*20; for old versions of MATLAB b = bsxfun(@plus,mult(:)',(1:45)'*20);

mehr als 8 Jahre vor | 0

Beantwortet
find a rows in matrix and its position in that matrix ?
In general case: [~,ji] = cellfun(@(x)ismember(B,x,'rows'),out,'un',0); jj_cell = find(cellfun(@(x)x>0,ji)); ii_r...

mehr als 8 Jahre vor | 0

Beantwortet
take selected rows from given matrix
out = A(10:10:end,:);

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Closest value between two vectors
kl =[1 5 9 8 12 32 203 1003]; z = randi([1 1003],8,1); [~,ii] = m...

mehr als 8 Jahre vor | 1

Beantwortet
Extracting column no. from an array based on values in another array
Use |ismember| Array1 = {'A','B','C','D','E','F'} Array2 = {'B','D'} [~,ii] = ismember(Array2,Array1)

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Divide a Large Matrix into Smaller Matrices in a Loop
|mat1| - matrix with size (20,5) row1 = 4; Matrix1 = permute(reshape(mat1.',size(mat1,2),row1,[]),[2,1,3]);

mehr als 8 Jahre vor | 1

Beantwortet
How to find the largest product?
Op! Everyone solves someone else's homework ... I also want! :) [product1, ind] = max(prod(hankel(a(1:end-b+1),a(end-b+1:en...

mehr als 8 Jahre vor | 0

Beantwortet
better method for evaluating matrix
N = 500; x = 2*pi*linspace(0,1,N); s = sin(x(:)' - x(:)); for old versions of MATLAB: s = sin( bsxfun(@minus,...

mehr als 8 Jahre vor | 1

Beantwortet
Error with indexing 'First argument must be numeric or logical'
Result = zeros(size(index)); t = ~cellfun(@isempty,index); Result(t) = cellfun(@(mm,ii)min(mm(ii)),M(t),index(t));

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Create a matrix by shifting a matrix column by column to
b = kron(convmtx(a(1,:),3),ones(size(a,1),1)); or s = size(a); r = 2*s(2); v = (1:s(1))'; b = kron(a0(rem((1:...

mehr als 8 Jahre vor | 0

Beantwortet
Help to vectorise a conditional cumulative sum
C = sum(tril(W(:) > W(:)',-1).*L(:)',2);

mehr als 8 Jahre vor | 0

Beantwortet
Why can't I read date and time when I import data from txt into matlab?
T = readtable('dt.txt','ReadVariableNames',false,'Format','%{dd-MM-yyyy HH:mm:SS}D','delimiter','\n');

mehr als 8 Jahre vor | 0

Beantwortet
Replacing elements of a matrix
InitData = randi(150,2,2,15,15); out = reshape(permute(InitData,[1 3 2 4]),30,[]); or InitData = arrayfun(@(x)randi...

mehr als 8 Jahre vor | 0

Beantwortet
Standard deviation of each elements in multiple matrices
A = cat(3,A1,A2,A3,...,AN); here A1,A2,...,AN - your matrices out = std(A,[],3,'omitnan');

mehr als 8 Jahre vor | 1

Mehr laden