I need switch case command to display two outputs with one input

4 次查看(过去 30 天)
I want wondering if switch case functions are able to put two different outputs with one input? I have the problem when user enters '2' I want the output to become 697hz,1336hz. Or would i have to set up each individual number to an output?
This is my graph 1,2,3,697hz are in a column 1,4,7,* are in a row
1 2 3 697hz
4 5 6 770hz
7 8 9
* 0 #
1209hz,1336hz,
This is what I tried .
function [lowFrequency, highFrequency]=pushbutton_to_DTMF(string)
Number = input('enter #','s');
switch Number
case{'1','2','3'};
disp('697')
case{'1','4','7','*'}
disp('1209')
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by