Please help me for matlab code computational methods in engi

Please help me for matlab code (computational methods in engineering)

Write a MATLAB script that finds the unique values (non-repeated values) in a given array. Do not use unique(), find() or any other Matlab functions. \"Matlab script\" means \"code in the editor page\". Remember you type \"edit\" into command window and editor opens. Start your code with the below line. Your script must find the unique values in the array A. A = randi(100, 1, 100); Before starting your homework, I recommend you to study the tutorials, and do lots of examples. After that, you will be able to do homework more easily. How to submit your homework? Submit your homework into the lecture. Name your script(m-file) as \"yournameSurnameHWl.m\". For example, gokhandemirkiranHWl.m o Due date is: 31 October 2016.

Solution

MATLAB code is:

clear all
close all
clc
A=sort(input(\'Enter Array : \'));
len=length(A);
B(1)=A(1);
j=2;
for i=2:length(A)
if A(i)==B(j-1);
else
B(j)=A(i);
j=j+1;
end
end
  
  
B()\'

sample output is

Enter Array : randi(100,1,100)

ans =

1
3
4
5
7
8
9
12
14
15
18
19
22
23
24
25
26
27
30
31
32
33
34
37
38
40
41
43
44
45
46
49
50
51
52
53
54
55
56
58
59
60
61
65
66
67
69
71
72
77
78
79
84
86
87
90
91
92
94
95
96
97

Please help me for matlab code (computational methods in engineering) Write a MATLAB script that finds the unique values (non-repeated values) in a given array.
Please help me for matlab code (computational methods in engineering) Write a MATLAB script that finds the unique values (non-repeated values) in a given array.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site