Actividad de desarrollo en Octave:
1) Enunciado:
Desarrollar en Octave, las gráficas de la función hipótesis h(x), según se indica en la figura:
2) Solución:
2.1.)
octave-3.2.4.exe:14> x=[1,2,3]
x =
1 2 3
octave-3.2.4.exe:15> h(x)=1.5 + 0 * x
h =
1.5000 1.5000 1.5000
octave-3.2.4.exe:16> plot (x, h(x))
octave-3.2.4.exe:17>
2.2.)
octave-3.2.4.exe:18> x=[1,2,3]
x =
1 2 3
octave-3.2.4.exe:19> h(x)=0 + 0.5 * x
h =
0.50000 1.00000 1.50000
octave-3.2.4.exe:20> plot (x, h(x))
octave-3.2.4.exe:21>
2.3.)
octave-3.2.4.exe:21> x=[1,2,3]
x =
1 2 3
octave-3.2.4.exe:22> h(x)=1 + 0.5 * x
h =
1.5000 2.0000 2.5000
octave-3.2.4.exe:23> plot (x, h(x))
octave-3.2.4.exe:24>
No hay comentarios:
Publicar un comentario