Specify one dimension as variable size in Matlab Coder

조회 수: 2 (최근 30일)
Andreas
Andreas 2012년 3월 6일
Hi!
I wish to graphically (in the matlab coder window) specify one dimension of an input as variable size and one dimension as fixed size. How do I achieve this?

채택된 답변

Titus Edelhofer
Titus Edelhofer 2012년 3월 6일
Hi,
I guess you mean the MATLAB Coder project settings? When you specify the input variable, use a ":" to specify a variable dimension, e.g.,
:10 x 1
makes the number of rows variable (between 1,...,10) and the number of columns fixed. Use
:inf x 1
if you don't want to have an upper limit. Depending on the code you will need to use "dynamic memory" (on the memory tab) ...
Titus

추가 답변 (1개)

UJJWAL
UJJWAL 2012년 3월 6일
Hi,
Although i did not understand your question very well but this is i think is your question :-
If you want to create a variable 'a' of dimension x by 23 and you want x to be given by a user , then you can do that by coding very easily, Just input x , and create a as follows for example -
a = zeros(x,23);
As far as doing it graphically is concerned, which i think is ur question, then well design a GUI and from there take the input x. After that you can write the corresponding code as the same.
Hope it helps

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by