Match text in cell arrays and copy values to another

1 次查看(过去 30 天)
Hi
I have a cell array (one of many) that looks like this: on the left is the sector name. On the right is the emission value of that sector.
Let us assume the name of the cell array is E30
'Coal Mine (open)' 0.016182475
'Food & Drink' 0.004392493
'Gas Platform' 0.00377076
'Gas Terminal' 0.023197913
'Glass' 0.031353608
'LNG Terminal' 0.027425894
'NRMM' 0.421852383
'Oil Terminal' 0.093687465
'Other Iron and Steel' 0.004623789
'Other Minerals' 0.004241753
'Other industry' 6.61E-05
'Paper' 0.002562681
'Vehicles' 0.000265986
I want to copy the values only to the cooreponding exact row (sector name) and E30 column in the new array below (leaving the empty sectors as they are)
Sector E25 H25 CCS25 E30
'Coal Mine (open)'
'Food & Drink'
'Gas Platform'
'Gas Terminal'
'Glass'
'NRMM'
'Oil Terminal'
'Other Chemicals'
'Other Iron and Steel'
'Other industry'
'Paper'
'Vehicles'
'Ammonia'
'Refining'
'LNG Terminal'
'Non ferrous metal'
'Iron (Port Talbot Scunthorpe)'
'Lime'
'Oil Platform'
'Other Minerals'
'Cement'
'Ethylene'
'Compressor Station'
'Construction'
'Other Fuel Production'
'Waste Processing'
Is there please general way to do that? If you want these info above as Excel, these are attached.
Many thanks

采纳的回答

Image Analyst
Image Analyst 2021-6-21
Look into ismember()

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Oil, Gas & Petrochemical 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by