Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
UTA
UTA 2013 年 9 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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.

回答 (0 件)

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by