![]() The first element ‘11’ is declared as ‘var 1’, and the second elements ‘29’ is declared as ‘var 2’. In example 1(a), not equal operator used by the symbolic method and in example 1(c), the same problem illustrated by using syntax ‘ne’. In this two examples, elements are different therefore, we will get the result as 1. In example 1(b) and 1(d), elements are the same therefore, we will get the result as 0 by using both symbolic and syntax methods, respectively. In the previous example, input data was in a single element(single dimension), but if the data has multiple elements then not equal to operation will compare every element from the database and gives output individually for each element, which is illustrated in example 2(a) by using both the methods. In example 2(b), we can see data is multi-dimensional (matrix) it has three rows and four columns, so not the equal operation will work on every element of the matrix, and it will give result in the form of three rows and four columns. In this example type of input, arguments are different. Previously we have seen simple integers now we will consider a complex variable as elements. Here the input is multidimensional as well as each element is a complex variable. On such type of dataset, not equal operator compares real and imaginary parts of every element and gives results accordingly, illustrated in example 3. In this example, we will consider input in forms characters and strings. In example 4(a), first input is the word ‘hellomatlab’, and the second input is ‘m’, which is a single letter. The not equal operation will compare each element from a word with a single letter ‘m’, and it will give a result in the form of an array. And in example 4(b), the first input is an array of words which is compared with a single word, so not equal operator will compare all the words from the first input with the word ‘hello’, and it will also give output in the form of an array. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |