SlideShare uma empresa Scribd logo
1 de 11
Primjena računara

Različiti oblici naredbe plot
Naredba subplot
› subplot omogućava da istovremeni prikaz
  više slika dijagrama u istom prozoru
› Naredba
                  subplot(m,n,p)
deli prozor slike u matricu, tj. na mxn malih
oblasti, a zatim bira p-tu oblast za tekući
prozor slike. Crteži su numerisani po
redovima, sleva nadesno, odozgo nadole.
Primjer
› Na istom dijagramu nacrtati grafike funkcija
  sinx, cosx, (x-1) 2,ex

    x=[0:0.01:2*pi];
    subplot(2,2,1),plot(y1);
    subplot(2,2,2),plot(y2);
    subplot(2,2,3),plot(y3);
    subplot(2,2,4),plot(y4);
1                                      1

0.5                                    0.5

  0                                      0

-0.5                                   -0.5

 -1                                     -1
       0   2000   4000   6000   8000          0   2000   4000   6000   8000


600                                     40

                                        30
400
                                        20
200
                                        10

  0                                      0
       0   2000   4000   6000   8000          0   2000   4000   6000   8000
Zadatak
› Na istom dijagramu nacrtati 3 proizvoljne
  funkcije u istom redu.
› Na istom dijagramu nacrtati 3 proizvoljne
  funkcije u istoj koloni.
Naredba plot
› Koristeći naredbu plot na istom grafiku
  nacrtati sinisnu i kosinusnu funkciju.
  Sinusnu funkciju nacrtati plavim plusićima,
  kosinusnu fju nacrtati zelenim tačkicama.
  Postaviti   oznake     koordinatnih     osa
  .Napomena:     nije   dozvoljeno     korisiti
  naredbu hold on.
› Opšta sintaksa naredbe plot je sljedeća:
          plot(x,y,'color_style_marker')
› Oznake za boju su 'c', 'm', 'y', 'r', 'g', 'b', 'w' i
  'k' . One odgovaraju početnim slovima
  engleskih naziva za boje, tj. cyan, magenta,
  yellow, red, green, blue, white i black.
› Oznake za vrste linija su '-' za punu liniju, '-
  -' za isprekidanu liniju, ':' za tačkastu liniju,
  '-.' za crta-tačka liniju i 'none', koja
  označava da nema linije.
› Markeri koji se obično koriste su '+', 'o', '*' i
  'x'.
Rješenje
 x=[0:0.1:2*pi];
 y1=sin(x);
 y2=cos(x);
 plot(x,y1,'b +',x,y2,'g .')
 xlabel('x osa'); ylabel('y osa')
1

        0.8

        0.6

        0.4

        0.2
y osa




          0

        -0.2

        -0.4

        -0.6

        -0.8

         -1
               0   1   2   3           4   5   6   7
                               x osa
Naredba legend
x=[0:0.1:2*pi];
y1=sin(x);
y2=cos(x);
plot(x,y1,'b +',x,y2,'g .')
xlabel('x osa');
ylabel('y osa');
legend('Kosinus','Sinus','Location','North')
x=[0:0.1:2*pi];
y1=sin(x);
y2=cos(x);
y3=(sin(x)).^2;
hold on
p1=plot(x,y1,'b');
p2=plot(x,y2,'g');
p3=plot(x,y3,'r');
legend([p1 p3], {'sinus','sinus na kvadrat'})

Mais conteúdo relacionado

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Subplot

  • 2. Naredba subplot › subplot omogućava da istovremeni prikaz više slika dijagrama u istom prozoru › Naredba subplot(m,n,p) deli prozor slike u matricu, tj. na mxn malih oblasti, a zatim bira p-tu oblast za tekući prozor slike. Crteži su numerisani po redovima, sleva nadesno, odozgo nadole.
  • 3. Primjer › Na istom dijagramu nacrtati grafike funkcija sinx, cosx, (x-1) 2,ex x=[0:0.01:2*pi]; subplot(2,2,1),plot(y1); subplot(2,2,2),plot(y2); subplot(2,2,3),plot(y3); subplot(2,2,4),plot(y4);
  • 4. 1 1 0.5 0.5 0 0 -0.5 -0.5 -1 -1 0 2000 4000 6000 8000 0 2000 4000 6000 8000 600 40 30 400 20 200 10 0 0 0 2000 4000 6000 8000 0 2000 4000 6000 8000
  • 5. Zadatak › Na istom dijagramu nacrtati 3 proizvoljne funkcije u istom redu. › Na istom dijagramu nacrtati 3 proizvoljne funkcije u istoj koloni.
  • 6. Naredba plot › Koristeći naredbu plot na istom grafiku nacrtati sinisnu i kosinusnu funkciju. Sinusnu funkciju nacrtati plavim plusićima, kosinusnu fju nacrtati zelenim tačkicama. Postaviti oznake koordinatnih osa .Napomena: nije dozvoljeno korisiti naredbu hold on.
  • 7. › Opšta sintaksa naredbe plot je sljedeća: plot(x,y,'color_style_marker') › Oznake za boju su 'c', 'm', 'y', 'r', 'g', 'b', 'w' i 'k' . One odgovaraju početnim slovima engleskih naziva za boje, tj. cyan, magenta, yellow, red, green, blue, white i black. › Oznake za vrste linija su '-' za punu liniju, '- -' za isprekidanu liniju, ':' za tačkastu liniju, '-.' za crta-tačka liniju i 'none', koja označava da nema linije. › Markeri koji se obično koriste su '+', 'o', '*' i 'x'.
  • 8. Rješenje x=[0:0.1:2*pi]; y1=sin(x); y2=cos(x); plot(x,y1,'b +',x,y2,'g .') xlabel('x osa'); ylabel('y osa')
  • 9. 1 0.8 0.6 0.4 0.2 y osa 0 -0.2 -0.4 -0.6 -0.8 -1 0 1 2 3 4 5 6 7 x osa
  • 10. Naredba legend x=[0:0.1:2*pi]; y1=sin(x); y2=cos(x); plot(x,y1,'b +',x,y2,'g .') xlabel('x osa'); ylabel('y osa'); legend('Kosinus','Sinus','Location','North')