WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

Druckverteilung grafisch darstellen

 

Hans143

Gast


Beiträge: ---
Anmeldedatum: ---
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 02.03.2016, 12:53     Titel: Druckverteilung grafisch darstellen
  Antworten mit Zitat      
Hallo Leute,

ich möchte gerne mit Scilab eine Druckverteilung darstellen. Ich habe also 25 Werte von sensorischen Flächen (4x4cm) und eine gesamte Fläche von 26x26cm. Den darauf einwirkenden Druck möchte ich verschieden farbig in einer Grafik darstellen.

Wie kann ich die einzelne Flächen in einem Plot darstellen und die Farbe abhängig von den Werten ändern?

Ich habe schon etwas mit Sfgrayplot herumprobiert, aber komme da nicht so richtig weiter.

Grüße

Hans143


Jan S
Moderator

Moderator


Beiträge: 11.057
Anmeldedatum: 08.07.10
Wohnort: Heidelberg
Version: 2009a, 2016b
     Beitrag Verfasst am: 02.03.2016, 13:05     Titel: Re: Druckverteilung grafisch darstellen
  Antworten mit Zitat      
Hallo Hans143,

25 Flächen a 4x4cm ergeben aber nicht 26x26cm. Falls dies für die Darstellung von Belang ist, erkläre das bitte genauer.

Zitat:
Den darauf einwirkenden Druck möchte ich verschieden farbig in einer Grafik darstellen.

Als Kurvenverläufe? Als 2-D Fläche? Oder in 3D? Zeitlich variierende Farben?

Zitat:
Ich habe schon etwas mit Sfgrayplot herumprobiert, aber komme da nicht so richtig weiter.

Poste bitte den Code und erkläre, was noch nicht wie gewünscht funktioniert.

Gruß, Jan
Private Nachricht senden Benutzer-Profile anzeigen
 
Hans143

Gast


Beiträge: ---
Anmeldedatum: ---
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 02.03.2016, 14:58     Titel:
  Antworten mit Zitat      
Zitat:
5 Flächen a 4x4cm ergeben aber nicht 26x26cm. Falls dies für die Darstellung von Belang ist, erkläre das bitte genauer.

Zwischen den Flächen sind jeweils 1cm Lücken.

Zitat:
Als Kurvenverläufe? Als 2-D Fläche? Oder in 3D? Zeitlich variierende Farben?

Als 2D-Fläche und zeitlich veränderlich, die Werte sollen später mal über die serielle Schnittstelle reinkommen.

Folgendes habe ich erstmal ausprobiert:

Die Funktionen x^2+y^2 habe ich einfach erstmal zum Testen ausgewählt.

Diese Funktion bestimmt aber die Farbgebung, richtig?
Ein Bild von dem Ergebnis habe ich auch angehängt.


Code:

clear;
clc;

// function definition
function z=cap1(x1,y1), z=x1^2*y1^2; endfunction
function z=cap2(x2,y2), z=x2^2*y2^2; endfunction
function z=cap3(x3,y3), z=x3^2*y3^2; endfunction
function z=cap4(x4,y4), z=x4^2*y4^2; endfunction
function z=cap5(x5,y5), z=x5^2*y5^2; endfunction
function z=cap6(x6,y6), z=x6^2*y6^2; endfunction
function z=cap7(x7,y7), z=x7^2*y7^2; endfunction
function z=cap8(x8,y8), z=x8^2*y8^2; endfunction
function z=cap9(x9,y9), z=x9^2*y9^2; endfunction
function z=cap10(x10,y10), z=x10^2*y10^2; endfunction
function z=cap11(x11,y11), z=x11^2*y11^2; endfunction
function z=cap12(x12,y12), z=x12^2*y12^2; endfunction
function z=cap13(x13,y13), z=x13^2*y13^2; endfunction
function z=cap14(x14,y14), z=x14^2*y14^2; endfunction
function z=cap15(x15,y15), z=x15^2*y15^2; endfunction
function z=cap16(x16,y16), z=x16^2*y16^2; endfunction
function z=cap17(x17,y17), z=x17^2*y17^2; endfunction
function z=cap18(x18,y18), z=x18^2*y18^2; endfunction
function z=cap19(x19,y19), z=x19^2*y19^2; endfunction
function z=cap20(x20,y20), z=x20^2*y20^2; endfunction
function z=cap21(x21,y21), z=x21^2*y21^2; endfunction
function z=cap22(x22,y22), z=x22^2*y22^2; endfunction
function z=cap23(x23,y23), z=x23^2*y23^2; endfunction
function z=cap24(x24,y24), z=x24^2*y24^2; endfunction
function z=cap25(x25,y25), z=x25^2*y25^2; endfunction

// first row
x1 = linspace(1,5,4);
y1 = linspace(25,21,4);
x2 = linspace(6,10,4);
y2 = linspace(25,21,4);
x3 = linspace(11,15,4);
y3 = linspace(25,21,4);
x4 = linspace(16,20,4);
y4 = linspace(25,21,4);
x5 = linspace(21,25,4);
y5 = linspace(25,21,4);

// second row
x6 = linspace(1,5,4);
y6 = linspace(20,16,4);
x7 = linspace(6,10,4);
y7 = linspace(20,16,4);
x8 = linspace(11,15,4);
y8 = linspace(20,16,4);
x9 = linspace(16,20,4);
y9 = linspace(20,16,4);
x10 = linspace(21,25,4);
y10 = linspace(20,16,4);

// third row
x11 = linspace(1,5,4);
y11 = linspace(15,11,4);
x12 = linspace(6,10,4);
y12 = linspace(15,11,4);
x13 = linspace(11,15,4);
y13 = linspace(15,11,4);
x14 = linspace(16,20,4);
y14 = linspace(15,11,4);
x15 = linspace(21,25,4);
y15 = linspace(15,11,4);

// fourth row
x16 = linspace(1,5,4);
y16 = linspace(10,6,4);
x17 = linspace(6,10,4);
y17 = linspace(10,6,4);
x18 = linspace(11,15,4);
y18 = linspace(10,6,4);
x19 = linspace(16,20,4);
y19 = linspace(10,6,4);
x20 = linspace(21,25,4);
y20 = linspace(10,6,4);

// fifth row
x21 = linspace(1,5,4);
y21 = linspace(5,1,4);
x22 = linspace(6,10,4);
y22 = linspace(5,1,4);
x23 = linspace(11,15,4);
y23 = linspace(5,1,4);
x24 = linspace(16,20,4);
y24 = linspace(5,1,4);
x25 = linspace(21,25,4);
y25 = linspace(5,1,4);

// clear graphic
clf();
// set colormap
set(gcf(),"color_map",[jetcolormap(100)]);

Sfgrayplot(x1,y1,cap1,strf="081",);
Sfgrayplot(x2,y2,cap2,strf="081",);
Sfgrayplot(x3,y3,cap3,strf="081",);
Sfgrayplot(x4,y4,cap4,strf="081",);
Sfgrayplot(x5,y5,cap5,strf="081",);
Sfgrayplot(x6,y6,cap6,strf="081",);
Sfgrayplot(x7,y7,cap7,strf="081",);
Sfgrayplot(x8,y8,cap8,strf="081",);
Sfgrayplot(x9,y9,cap9,strf="081",);
Sfgrayplot(x10,y10,cap10,strf="081",);
Sfgrayplot(x11,y11,cap11,strf="081",);
Sfgrayplot(x12,y12,cap12,strf="081",);
Sfgrayplot(x13,y13,cap13,strf="081",);
Sfgrayplot(x14,y14,cap14,strf="081",);
Sfgrayplot(x15,y15,cap15,strf="081",);
Sfgrayplot(x16,y16,cap16,strf="081",);
Sfgrayplot(x17,y17,cap17,strf="081",);
Sfgrayplot(x18,y18,cap18,strf="081",);
Sfgrayplot(x19,y19,cap19,strf="081",);
Sfgrayplot(x20,y20,cap20,strf="081",);
Sfgrayplot(x21,y21,cap21,strf="081",);
Sfgrayplot(x22,y22,cap22,strf="081",);
Sfgrayplot(x23,y23,cap23,strf="081",);
Sfgrayplot(x24,y24,cap24,strf="081",);
Sfgrayplot(x25,y25,cap25,strf="081",);

xtitle("Pressure Map");
 


pressure_map.PNG
 Beschreibung:

Download
 Dateiname:  pressure_map.PNG
 Dateigröße:  88.26 KB
 Heruntergeladen:  569 mal
 
Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2024 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.