Info

This question is closed. Reopen it to edit or answer.

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

1 view (last 30 days)
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.

Answers (0)

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!