Using fprintf I want to produce an output that looks like this:
names abc and numbers 1
names def and numbers 2
names ghi and numbers 3
This is the code I tried using to achieve this:
names= {'abc','def','ghi'}
numbers = [1 2 3];
fprintf('names %s and numbers %2.2f \n',names{1:3},numbers)
unfortunatly the output it produces looks like this:
names abc and numbers 100.00
names ef and numbers 103.00
names hi and numbers 1.00
names and number
Does anyone know how to solve this issue? Or is it even possible to combine fprintf with cell-arrays? Thanks in advance