Question

the last output given using for loop

May i know why the following for loop produces e(end) of only n=5 and not from n=1? e = linspace(-pi,pi,5); >> d=1; >> ...

2 years ago | 1 answer | 0

Question

using find function and logical array

If i have a matrix Z=[1 0 1;0 1 0;1 0 1]; >> find(Z==1) ans = 1 3 5 7 9 >> find(Z(Z==1)...

2 years ago | 3 answers | 0

Question

Difference between mod and rem functions

May i know why is mod(4,-3) ans = -2 >> rem(4,-3) ans = 1 these two answers different?

2 years ago | 2 answers | 1

Question

Number of times an element appears

If i have a vector prize = [3;5;1;2;1] and the year =[2007;2018;2011;2011;2018] How do I find the number of times each year ap...

2 years ago | 1 answer | 0

Question

How to check the accuracy of estimation

Using the approximated volume i have 0.51666667 and the true volume is 0.52359878 , the error is 0. *00* 693211 so it will be ac...

2 years ago | 1 answer | 0

Question

Calculating accuracy of decimal places and print out the values

How to find the accuracy of decimal places between the integral approximation and the MATLAB built-in integral function? Eg: if ...

2 years ago | 2 answers | 0

Question

Determining the total value of the number in each position of a matrix that corresponds to another same length matrix

Let's say i have a column vector medals = [1;1;5;7;3;1] and i have another column vector year = [2007;2009;2011;2018;2007;200...

2 years ago | 2 answers | 0

Question

Plotting circles horizontally through entire range of x values on a constant y value

How do i plot circles for the entire range of the x values for a constant y value instead of a horizontal line through the range...

2 years ago | 1 answer | 0

Question

Categorising the star into different types

Let's say i have a column vector string, name=['K';'K';'G';'A';'B'] and i have a matrix , type='ABGK' I have another matrix i...

2 years ago | 2 answers | 0

Question

How to categorise a column vector

May i know how to categorise a given column vector into different types of vector? eg: given X=[A;A;G;K;M] and have to categori...

2 years ago | 1 answer | 0

Question

Use loops to produce the beautyofmath shown.The script should iterate from 1 to 11 to produces expression on the left, and perform specified operation to get the results shown on the right.

1x8+1=9 12x8+2=98 123x8+3=987 1234x8+4=9876 12345x8+5=98765 123456x8+6=987654 1234567x8+7=9876543 1234567...

2 years ago | 1 answer | 0

Question

how do i write a program that calculate side length c using pythagoras' theorem(a2+b2=c2) assuming a and b to be integer values starting from 1, and print out the pythagorean results that satisfy a>=1,b>=1 and c<=10.

<</matlabcentral/answers/uploaded_files/113639/Screen%20Shot%202018-04-18%20at%208.02.55%20PM.png>> how do i write a program ...

2 years ago | 2 answers | 0

Question

How to remove the word 'Pythogorean results are' for the second line onwards?

<</matlabcentral/answers/uploaded_files/112399/Screen%20Shot%202018-04-10%20at%2011.26.52%20AM.png>>

2 years ago | 1 answer | 0

Question

There's an error using input function in my computer , how do I solve it?

clear all; close all; clc; name=input('Enter your name:','s') surname=input('Enter your surname:','s') loca...

2 years ago | 2 answers | 0