Converting discrete variables into continuous variables

11 ビュー (過去 30 日間)
Augustin Arnault
Augustin Arnault 2011 年 6 月 14 日
回答済み: Gent sir 2020 年 1 月 2 日
Hello, during a project i am currently working on, i need to use the multiobjective genetic algorithm. However the variables that are used are all discrete and therefore the conditions cannot be taken in account.
Do you know what kind of program or function i can use to transform those discrete variables into continuous variables ?
Thank you. (pardon my english, i am not completely familiar with mathematical vocabulary)

回答 (3 件)

Yella
Yella 2011 年 6 月 16 日
Try to decrease the space between input values and take more output values do it looks like a continuous signal though it may be discrete.. thank you

Matthew M.
Matthew M. 2011 年 6 月 16 日
Since MATLAB is array-based, I don't think it handles truly continuous variables, at least not outside something like the Symbolic Math Toolbox (which I haven't used). Like Yella said, you could just use a finer grid for your variables.
I'm not familiar with the multiobjective genetic algorithm. Why do the conditions require continuous variables?

Gent sir
Gent sir 2020 年 1 月 2 日
you can use vq = interp1(x,v,xq) code
imagine you have x vector represent the time, i.e x = [1 2 3 4 5]
and v is the velocity at each time , i.e v = [ 3 9 5 6 10] .
you want to find the velocity at 4.5 second
you can use this command
v_estimated = interp1(x,v,4.5)
the answer is v_estimated =8

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by