Using multiple inputs with nftool

1 回表示 (過去 30 日間)
Zdenek Vrana
Zdenek Vrana 2023 年 5 月 7 日
コメント済み: Zdenek Vrana 2023 年 6 月 4 日
My task is to approximate an eggholder function ( https://www.sfu.ca/~ssurjano/egg.html ).
I am currently trying to figure out how to choose both of these 2 variables (x and y) as inputs in nftool.
If it's easier to do with another command, I could use it instead of nftool.
x = linspace(-512, 512, 1025);
y = linspace(-512, 512, 1025)';
for i=1:length(x)
for j =1:length(y)
z(i,j) = -(y(j,1)+47) .* sin(sqrt(abs(y(j,1)+x(1,i)/2+47))) - x(1,i) .* sin(sqrt(abs(x(1,i)-(y(j,1)+47))));
end
end

回答 (1 件)

Sarthak
Sarthak 2023 年 5 月 17 日
Hi Zdenek,
As per my understanding you can reshape your inputs to a single input matrix.
inputs = [x(:), y(:)];
This inputs can then be used for any suitable function.
  1 件のコメント
Zdenek Vrana
Zdenek Vrana 2023 年 6 月 4 日
Thank you, it worked. However, I have another issue.
After training the network, every new input (eg. one pair of X and Y values) gives me 1025 predicted values. I think it's because the inputs (for traning) are only 2 rows, but the function (the result of those 2 inputs) is a 1025x1025 matrix.
How do I solve this?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSignal Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by