i need a solutions for these question in Matlab thanks 8 Buil-in MATLAB Function
ID: 2261715 • Letter: I
Question
i need a solutions for these question in Matlab
thanks
Explanation / Answer
3.1) From the MATLAB function definitions, as fix rounds elements to the nearest integer towards zero, and floor rounds element to the nearest integer less than or equal to that element.
Thus for positive numbers, both of them would become the same answer as for the case of x=3.3
fix(x)=3, as 3 is the nearest integer for x towards zero and and floor(x)=3, as 3 is the nearest integer less than x.
But for negative numbers, both of them would differ by 1, as for the case of y=-3.3
fix(y)=-3, as -3 is the nearest integer for y towards zero and floor(y)=-4, as -4 is the nearest integer less than y.
The same can be checked from the MATLAB code:
clc;clear all;close all;
x=3.3;y=-3.3;
m=fix(x);n=floor(x);
p=fix(y);q=floor(y);
display(m);display(n);
display(p);display(q);
3.2) By implementing the following code in MATLAB, we can obtain the different values of logb(10) for b=1:10
clc;clear all;close all;
b=1:10;
for i=1:length(b)
ans(i)=log(10)./log(b(i));
end
display(ans);
Result: for b=1 : 10
answer = Inf 3.3219 2.0959 1.6610 1.4307 1.2851 1.1833 1.1073 1.0480 1.0000
3.3)By implementing the equation in MATLAB we get:
clc;clear all;close all;
P0=100;r=0.9;t=10;
P=P0.*(exp(r.*t));
display(P);
Result: P = 810308.3927575385 (accurate) = 810308 rabbits (approximate)
3.4) By implementing the following code in MATLAB we can obtain the values of k:
clc;clear all;close all;
T=100:50:500;Q=8000;R=1.987;k0=1200;
k=k0.*(exp((-Q)./(R.*T)));
display(k);
3.5) Question is incomplete, as the figure mentioned in the question is not given(Figure P3.5).
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.