Passing an array into a function

Let x=[0.7840 0.0005 0.0817 0.5732] .When this array is given in a function as p1= Im_opt(p, x(1), x(2), x(3), x(4)), I get the result as -0.0023 but when I pass the array directly into the function as p1=Im_opt(p, 0.7840, 0.0005, 0.5732), I am getting the result as 0.0033. Why I am getting different value for the same array? Please anyone help me with this.

3 Comments

Stephan
Stephan on 27 Jan 2019
Edited: madhan ravi on 27 Jan 2019
Im_opt appears to be not a built in function. Can you provide it or a link to its documentation?
Im_opt is not a built in function and is used to encrypt the image and to find the correlation between the two images sir.

Sign in to comment.

 Accepted Answer

This is most likely the same problem than in your other question: The statement "Let x=[0.7840 0.0005 0.0817 0.5732]" is not true, but this is only the abbreviated display in the command window. See:
doc format
E.g. the 2nd value might not be "0.0005", but "0.000499", which is displayed identically, although the values differ.

More Answers (0)

Products

Release

R2016a

Asked:

on 27 Jan 2019

Edited:

on 29 Jan 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!