Create a cell array out of a struct - MATLAB Cody - MATLAB Central

Problem 152. Create a cell array out of a struct

Difficulty:Rate

Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column:

in:

S.foo = 'hello';
S.bar = 3.14;

out:

 {'foo', 'hello';
  'bar', 3.14}

Solution Stats

42.06% Correct | 57.94% Incorrect
Last Solution submitted on Mar 17, 2025

Problem Comments

Solution Comments

Show comments

Group

Project Euler II Image
Project Euler II
  • 12 Problems
  • 51 Finishers

Problem Recent Solvers2083

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page