Re: [問題] C 轉 matlab 遇到了一些問題
其實C要跟MATLAB溝通有很多方法:
方法1:存成檔案互相讀寫
方法2:把C程式加入MEX function 與MATLAB溝通
MATLAB ceil的用法.舉個MATLAB例子:
clc
clear all
A =133432320145; %你要切的
strA =num2str(A);
time = floor(length(strA)/8);
other = rem(length(strA),8);
x=zeros(1,length(strA)+1);
for i=1:time+1
if i<time+1
HI{i} = strA(1+8*(i-1):8*i);
elseif i==time+1
HI{i} = strA(1+8*(i-1):1+8*(i-1)+other-1);
end
end
HI %切完
顯示結果 HI = '13343232' '0145'
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.135.125.5
※ 編輯: okgogogo 來自: 220.135.125.5 (04/13 19:32)
※ 編輯: okgogogo 來自: 220.135.125.5 (04/13 19:37)
推
04/14 00:52, , 1F
04/14 00:52, 1F
→
04/14 00:54, , 2F
04/14 00:54, 2F
→
04/14 00:55, , 3F
04/14 00:55, 3F
→
04/14 00:55, , 4F
04/14 00:55, 4F
→
04/14 00:56, , 5F
04/14 00:56, 5F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):