Question

how can i convert an integer to an array in this function?

function a=get_array_num(n) end requirments: 1.no loops,if,recurion or logical operatos 2.no num2str or str2num ...

7 years ago | 1 answer | 0

Question

how do i create a recursive function that gives the number of digits in an integer? i.e. does the same that length function does in MATLAB

function r = length_of(n) end it seems to be easy but right now i'm stuck with it

7 years ago | 2 answers | 0

Question

How can I find a sub matrix of a matrix (of any size) where this happens:(Homework question)

For example: A = [21 25 -5 4; 21 25 -5 4; 22 26 21 22; 21 25 25 26; 21 25 -5 21]; the sub matrix of A is B = [21 25...

7 years ago | 1 answer | 0

Question

how can i check if n2 is a sub number of n1? (HW qst.)

for ex.: n1 = 123; n2 = 12; (n1>=n2) n2 is a sub number of n1 i can't make any use of strings or arrays

7 years ago | 3 answers | 0

Question

how can i compute the length of an integer?

if i have int = 12345; length_int = 5; ???

7 years ago | 3 answers | 0

Question

how can i get a matrix from an array like this:

Starting with a = [12 21 32]; I would like to get this: M = [12 21 32; 21 32 12; 32 12 21]; with size and leng...

7 years ago | 6 answers | 0

Question

how can i rescale ths axes of 2-D graph so the x-axis and the y-axis coordinates are: -4,-2,0,2,4?

thanks.

7 years ago | 1 answer | 0

Question

how can i determine whether a matrix of any size is sorted or not (by rows and by columns)?

suppose i have A = [1 2 3 4; 5 6 7 8] is sorted but A = [1 2 3 4; 5 6 8 7] is not diff(A) returns "1"-s mtrix if columns a...

7 years ago | 2 answers | 0

Question

how can i sort a matrix (all rows and columns are sorted) without using any special function like "sort"?

i guess it has to do something with "min" and "max" functions... for example: A = [2 3 4 5; 6 9 1 5]; %%% "A" can be of ...

7 years ago | 3 answers | 0

Question

i need to convert a string to a num without using the "str2num" function but in the final answer i have some undesired spaces. how can i remove them?

st = '23487'; x = double(st); y = x-48; y = 2 3 4 8 7 i want this in "normal" format of "23487"...

7 years ago | 2 answers | 0

Question

how can i convert a string to a number (without using the str2num function) so if the string represents a number the value is 1? (otherwise the value is 0)...

for example: st = '23487'; r = 1; (also '00023487' is acceptable or any number of leading zeros). but st = '-4e';...

7 years ago | 2 answers | 0

Question

Specialized sorting of array while preserving order

how can i sort an array (of even number of elements) so the elements on the left side are smaller than the elements on the righ...

7 years ago | 1 answer | 0