Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
UTA
UTA le 8 Sep 2013
Clôturé : MATLAB Answer Bot le 20 Août 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.

Réponses (0)

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by