Student Support Forum
-----
Student Support Forum: 'Problem with a function with two parameters' topicStudent Support Forum > General > Archives > "Problem with a function with two parameters"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic | Post New Topic
Author Comment/Response
yehuda ben-shimol
05/30/08 06:14am

Hi,
The expression has a wrong syntax

here is the solution

matrixa = {{0, 1, 0, 2}, {0, 0, 1, 1}};
matrixb = {{a, b, c, d}, {a, b, c, d}};
MapThread[If[#1 != 0, #1, #2] &, {matrixa, matrixb}, 2]
and the computed result

{{a, 1, c, 2}, {a, b, 1, 1}}


yehuda

URL: ,

Subject (listing for 'Problem with a function with two parameters')
Author Date Posted
Problem with a function with two parameters Joel Santos 05/28/08 03:05am
Re: Problem with a function with two parameters Xavier 05/29/08 1:26pm
Re: Problem with a function with two parameters Randy Silvers 05/29/08 8:08pm
Re: Problem with a function with two parameters yehuda ben-s... 05/30/08 06:14am
Re: Problem with a function with two parameters Joel Santos 06/03/08 09:52am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic | Post New Topic





 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: