Why do i need to use .^ notation ?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yash Shil Balgobin
am 3 Apr. 2021
Kommentiert: Yash Shil Balgobin
am 3 Apr. 2021
Why do i need to use the .^ notation ? Is there any other way around it ?
% This is my function.
function y = PBTask4P1_f(x)
y = 4.2*x.^4-5*x.^3-7*x;
plot(x,y);
xlabel('INPUT X')
ylabel('OUTPUT Y')
end
0 Kommentare
Akzeptierte Antwort
KALYAN ACHARJYA
am 3 Apr. 2021
Bearbeitet: KALYAN ACHARJYA
am 3 Apr. 2021
It's based on equation. .^ represent the element wise to the power of any array/vector.
See the example
a =
1 2 3 4 5 6
>> a.^2
ans =
1 4 9 16 25 36
Whereas a^2=a*a (Matrix Multiplication)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!