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 6900769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:35:19+00:00 2026-05-27T07:35:19+00:00

For this question, I’m supposed to create a NxN powers table in matlab using

  • 0

For this question, I’m supposed to create a NxN powers table in matlab using arrays.

The code I have so far is as follows:

C = [];
D = [];

N = input('Enter the value you would like to use for your NxN Powers Table: ');

for i = 1:N 
    for j = 1:N  
        C = [C;i^j];    
    end  
    C = transpose(C);
    D = [D;C];  
    C = [];
end

D

This code works perfectly fine for any numbers from 1-9, as soon as I enter anything greater than that, it prints out weird values.

Here is the output I have using 5 as an input, and the second one is using 10 as an input.

Enter the value you would like to use for your NxN Powers Table: 5

D =

       1           1           1           1           1
       2           4           8          16          32
       3           9          27          81         243
       4          16          64         256        1024
       5          25         125         625        3125


Enter the value you would like to use for your NxN Powers Table: 10

D =

  1.0e+010 *

0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000
0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000
0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000
0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0001
0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0002    0.0010
0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0002    0.0010    0.0060
0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0001    0.0006    0.0040    0.0282
0.0000    0.0000    0.0000    0.0000    0.0000    0.0000    0.0002    0.0017    0.0134    0.1074
0.0000    0.0000    0.0000    0.0000    0.0000    0.0001    0.0005    0.0043    0.0387    0.3487
0.0000    0.0000    0.0000    0.0000    0.0000    0.0001    0.0010    0.0100    0.1000    1.0000

Any ideas what could be wrong with my code? Seems like a simple fix, I just can’t figure out whats wrong with it. Any help is greatly appreciated. Thanks

  • 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-05-27T07:35:19+00:00Added an answer on May 27, 2026 at 7:35 am

    Notice the 1.0e+010 *. It means that the numbers should be multiplied by 10000000000. Five digits are not enough to print it. Insert format long or format short g to see the whole numbers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question follows an earlier one . Here is some code that reproduces the
This question was very helpful, however I have a list control in my report,
This question is related to: Casting items of a collection with code generation Since
This question might look naive, but I couldn't understand this code in the ViewModelLocator.cs
This question is in reference of the question: Setting the response content-type without using
This question is quite specific. I'm using Symfony2 White October Admin Bundle for generating
This question is regarding the behavior I observed while using const_cast for making a
This question is about code optimalization: What is better for performance and why (the
This question seems to have been asked a lot but all were trying to
This question is specific to Erlang, but may have general implications to other IO

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.