Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8601115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:46:09+00:00 2026-06-12T01:46:09+00:00

I need to find rp for each x but I’m having a hard time

  • 0

I need to find rp for each x but I’m having a hard time because matlab gives me this error

Error in enee_408e_hw2_pb1 (line 6)
rp=(z2*cos(t2)-z1*cos(x))/(z2*cos(t2)+z1*cos(x))

here is my code

x=0:.01:pi/2;
n2=1.7;
t2=asin(sin(x)/n2);
z1=377*cos(x);
z2=377\cos(x);
rp=(z2*cos(t2)-z1*cos(x))/(z2*cos(t2)+z1*cos(x));

I want to calculate rp for each angle from 0 to pi/2 and then plot it. What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:46:10+00:00Added an answer on June 12, 2026 at 1:46 am

    Every operation is perform on same cell in z1 and z2. Matlab/Ocatave calculate enquation based on variable’s type. So if you put * between vectors it try to calculate cross product. Probably problem was \, I have no idea what Matlab tried to do with it. Adding . before operator change approach to more natural (for non mathematical folks) and multiply corresponding cells.
    But still I’m not sure it this is what you expected

    rp=(z2.*cos(t2)-z1.*cos(x))./(z2.*cos(t2)+z1.*cos(x));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find the latest location of each cargo item in a consignment.
I have different blocks of 34 threads each (0...33). I need to find a
I need to find a better way to get the discount for each article
I need to find how many votes each one has. I have a count
There are several events, each with multiple meeting times. I need to find an
Given 2 strings s and t . I need to find for each substring
I have an script as following: $('.Addable').find('input').each(function () { if ($(this).attr('name')) { var Name
I need to find the distance between the 2nd and 3rd elements of each
I searched the forums but didn't find any answers to this question. I am
I need to find exact size for each character in an arbitrary font. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.