How to convert a scalar data into complex ?
17 ビュー (過去 30 日間)
古いコメントを表示
Hi
I have 3 coloumns of scalar data, each coloumn belongs to the data of a particular parameter. I have to plot the three parameters in a contour figure. Before that I have to convert the scalar data into a complex one. How shall I do this?
0 件のコメント
採用された回答
Wayne King
2012 年 6 月 28 日
A scalar can be complex by definition. A scalar is just a number. So I'm assuming you have real-valued data to start with. How are you going to determine the imaginary part?
You can simply make the attribute complex by
z = randn(100,3);
z = complex(z);
but to actually give it some meaningful imaginary part, you have to some way to assign it.
z = randn(100,3);
z = z+1j*ones(size(z));
2 件のコメント
Wayne King
2012 年 6 月 28 日
You have to have some way of assigning the imaginary part. If you are starting with real valued data, I don't know how you want to assign the imaginary part.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!