Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

how do I write a function with cell input from matlab to c code?

1 Ansicht (letzte 30 Tage)
UTA
UTA am 8 Sep. 2013
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hi everyone: my matlab code as follow:
function [ XP ] = seqRe_ali( test_cut, model_cut,P )
for i = 1 : size(P,1)
c = P(i,3);
t = P(i,2);
m = P(i,1);
reTest_ali{i} = test_cut{t}(c,:);
reModel_ali{i} = model_cut{m};
end
for i = 1 : size(reTest_ali,2)
reTest_matrix(i,:) = reTest_ali{i};
end
for i = 1 : size(reModel_ali,2)
reModel_matrix(i,:) = reModel_ali{i};
end
% Xs is like Xi*Wi' and Yi*Wi'.
XP{1} = reTest_matrix';
XP{2} = reModel_matrix';
end
where the input test_cut, model_cut is two cell with size 1*n, 1*m and in each cell is a matrix with size r*c; p is the matrix with size t*3; How do I switch these matlab code c code, because I want use cmex to call the c code in matlab to accelerate the run speed. Thank you so much.

Antworten (0)

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by