display contents of cell array and a vector together

2 views (last 30 days)
i have a cell array
cell_array = {'A' 'B' 'C'} and
value = [ 10 20 30]
how can i display the cell_array and value_vector together as a string or in a table
A = 10
B = 20
C = 30

Accepted Answer

Ameer Hamza
Ameer Hamza on 14 Mar 2020
Edited: Ameer Hamza on 14 Mar 2020
cell_array = {'A' 'B' 'C'};
value = [ 10 20 30];
arrayfun(@(x,y) fprintf('%s = %d\n', x{:}, y), cell_array, value);
Result
A = 10
B = 20
C = 30

More Answers (0)

Categories

Find more on Cell Arrays in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!