II. Plotting the Conversion
조회 수: 1 (최근 30일)
이전 댓글 표시
- Ask the user their name and store in a variable
- Ask user to enter 10 values as an array and store in a variable (bookend with square brackets)
- Convert the entire array to Celsius and store in a variable
- Plot the temperature conversion with labels and title
- Use black asterisks for the marker
- Copy and paste the plot below:
Please help! How do I do this?
답변 (1개)
Rohit Pappu
2020년 10월 29일
% Prompt to ask the user to enter name
prompt = ' Enter name ';
name = input(prompt,'s');
% Prompt to ask the user to enter array values with square brackets
prompt = 'Enter array of values';
temperature = input(prompt);
% Temperature conversion
celsius = (temperature - 32)*(5/9);
% Plotting Fahrenheit on X axis and Celsius on Y axis
plot(temperature,celsius,"LineStyle","none","Color",'k',"Marker","*");
xlabel('Fahrenheit');
ylabel('Celsius');
title('Plotting Fahrenheit vs Celsius');
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!