I want the graph

조회 수: 2 (최근 30일)
Raghad Saleh
Raghad Saleh 2021년 9월 26일
답변: Image Analyst 2021년 9월 26일

답변 (1개)

Image Analyst
Image Analyst 2021년 9월 26일
It looks like homework, so read this:
But the question didn't actually ask you to plot it, so I can do that part for you:
% Demo by Image Analyst
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 25;
fprintf('Beginning to run %s.m ...\n', mfilename)
x = linspace(0, 12, 1000);
f = 8 * sin(x) .* exp(-x) - 1;
plot(x, f, 'b-', 'LineWidth', 3);
grid on;
title('8 * sin(x) .* exp(-x) - 1 vs. x', 'FontSize', fontSize);
xlabel('x', 'FontSize', fontSize);
ylabel('f', 'FontSize', fontSize);
ax = gca;
ax.XAxisLocation = 'origin';
ax.YAxisLocation = 'origin';
g = gcf;
g.WindowState = 'maximized'
fprintf('Done running %s.m.\n', mfilename)
If you need help with your Newton Raphson code, please post that. We're not just going to hand it over to you since it's your homework.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by