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

  • SEARCH
  • Home
  • 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 8965595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:50:24+00:00 2026-06-15T16:50:24+00:00

I have three vectors A, B, and C. For each value in these vectors

  • 0

I have three vectors A, B, and C. For each value in these vectors I would like to solve the equation C^x = A^x + B^x. Unfortunately this is an equation that I have found to be solvable only iteratively, so I am attempting to use MATLAB’s “solve” function to find a solution for each case. My code is as follows:

exponents = zeros(100,1);

syms x

A = rand(100,1);
B = rand(100,1);
C = rand(100,1);

for i = 1:100

exponents(i) = eval(solve(C(i)^x == A(i)^x + B(i)^x));

end

Sometimes, however, the solution is unobtainable, which leads to the error message, “Warning: Explicit solution could not be found.” I am okay with this, but if I run into an unsolvable equation, I would like to simply leave the “exponents(i)” unchanged for that iteration and move onto the next one, instead of having my code abruptly stop. Any suggestions?

  • 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-15T16:50:26+00:00Added an answer on June 15, 2026 at 4:50 pm

    If you put the statement that causes the occasional error inside a try/catch statement, then the error will not cause execution to stop. For example, you could try:

    for i = 1:100
      try
        exponents(i) = eval(solve(C(i)^x == A(i)^x + B(i)^x));
      catch
        exponents(i) = NaN; 
      end;
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three classes that are closely coupled to each other, and I would
I have multiple vectors of varying lengths that I would like to plot next
I have a set of three vectors: x, y, and z that I want
I have three lists of float values and each of these lists are pretty
I have a large matrix that I would like to convert to sparse CSR
I have three vectors in an xts R object. Call them V1, V2, V3.
I have a problem where I have to add thirty-three integer vectors of equal
I have two vectors, v1 and v2 v1 <- c('one', 'two', 'three') v2 <-
Have three divs in a container that I want to float over a large
i have three lists with the same number of elements in each other, i

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.