필터 지우기
필터 지우기

How to write register/array into Simulink simple port RAM ?

조회 수: 1 (최근 30일)
Henry Buck
Henry Buck 2016년 3월 18일
편집: Henry Buck 2016년 3월 18일
Hi,
I have a block, inside it there is a Register. That Register is also an output from that block.
I want to write Register into a simple ram, outside that block. when I do so, too meny errors appear.
A part from that block:
function [gate_h,reg_out] = gate_cntrl_h(INDX,I1,V,reg_old)
n = 8;
gate_h = zeros(1,n);
reg_out = zeros(1,n/2);
switch INDX
case 0
reg_out(:) = 0;
case 1
if(min(V) > VC_limit)
[C,I] = min(V);
reg_out(I) = 1;
else
for j=1:length(reg_out)
if(reg_out(j)==reg_old(j))
reg_out(j)=reg_old(j);
else
[C,I] = min(V);
reg_out(I) = 1;
end
end
end
...
...
How can I write reg_out into an outside simple RAM ?
when I do so, too meny errors...
for example..
Error in port widths or dimensions. Output port 1 of 'gate_cntrl/Single Port RAM/din' is a [1x4] matrix.
Component: Simulink | Category: Block error
Error in port widths or dimensions. Input port 2 of 'gate_cntrl/Single Port RAM/wr_port' is a one dimensional vector with 1 elements.
Component: Simulink | Category: Block error
Can someone help me to solve it ?
Thanks, Henry

답변 (0개)

카테고리

Help CenterFile Exchange에서 String에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by