RosettaCodeData/Task/Create-a-two-dimensional-array-at-runtime/MATLAB/create-a-two-dimensional-array-at-runtime-1.m

11 lines
229 B
Mathematica
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
width = input('Array Width: ');
height = input('Array Height: ');
array = zeros(width,height);
array(1,1) = 12;
disp(['Array element (1,1) = ' num2str(array(1,1))]);
clear array; % de-allocate (remove) array from workspace