close all; clear; clc

choice = input("Choose a spring (1, 2, or 3): ");
if choice == 1
    k = 0.05;
elseif choice == 2
    k = 0.2;
elseif choice == 3
    k = 3;
else
    disp("Error: invalid choice")
    return
end

choice = input("Choose a mass (1 or 2): ");
if choice == 1
    m = 0.6;
elseif choice == 2
    m = 4;
else
    disp("Error: invalid choice")
    return
end

wn = (1 / (2 * pi)) * sqrt(k / m);
fprintf("Natural frequency: %d Hz\n", wn)