フィルターのクリア

Iterating through columns of data

1 回表示 (過去 30 日間)
Edward Robson
Edward Robson 2020 年 11 月 2 日
回答済み: Stephan 2020 年 11 月 2 日
Hi ,
I have two columns of data, voltage and current with 44058 rows.
I need a way of iterating through both and finding the resistance for every value?
Any ideas?
Thank you

回答 (1 件)

Stephan
Stephan 2020 年 11 月 2 日
% Example data
U_I_data = [10 0.5; 20 2; 25 4; 12 3; 18.5 2]
% R = U/I as an elementwise matlab operation
R = U_I_data(:,1) ./ U_I_data(:,2)
results in:
U_I_data =
10.0000 0.5000
20.0000 2.0000
25.0000 4.0000
12.0000 3.0000
18.5000 2.0000
R =
20.0000
10.0000
6.2500
4.0000
9.2500

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by