dear all, i am matlab new user and i have some problems about it.(adsbygoogle = window.adsbygoogle || []).push({});

I generated a code as below:

function data = findtext(redc,greenc,bluec)

txt=0;

if bitand(redc,4)== 4

txt=bitor(txt,128);

end

if bitand(redc,2)== 2

txt=bitor(txt,64);

end

if bitand(redc,1)== 1

txt=bitor(txt,32);

end

if bitand(greenc,4)== 4

txt=bitor(txt,16);

end

if bitand(greenc,2)== 2

txt=bitor(txt,8);

end

if bitand(greenc,1)== 1

txt=bitor(txt,4);

end

if bitand(bluec,2)== 2

txt=bitor(txt,2);

end

if bitand(bluec,1)== 1

txt=bitor(txt,1);

end

data=txt;

return

I save it as findtext.m file but i get the error as below:

??? Input argument "redc" is undefined.

Error in ==> findtext at 3

if bitand(redc,4)== 4

could anyone help to answer my question ? how to solve my problem ?

thanks so much

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab beginner needs help

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads - Matlab beginner needs | Date |
---|---|

MATLAB Beginner, Need Help with Histograms | May 31, 2012 |

Matlab beginner fprintf into .txt | Nov 5, 2011 |

Hi everyone. im a beginner to matlab, i want to calculate the fourier | May 21, 2011 |

Beginner Matlab and project | Oct 27, 2010 |

Beginner in matlaB i need lil help | Oct 2, 2009 |

**Physics Forums - The Fusion of Science and Community**