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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:49:08+00:00 2026-05-13T01:49:08+00:00

syms t; % Define symbolic var x. y = int( t^2 ); % Calculate

  • 0
 syms t;          % Define symbolic var x. 
 y = int( t^2 );  % Calculate integral of x; it should be t^3/3.
 x = [1:10]  

Now I want to calculate y(x), it should be [1/3, 8/3, .., 1000/3].

  • 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-13T01:49:08+00:00Added an answer on May 13, 2026 at 1:49 am

    Short answer: use subs. Long answer:

     >> syms t;
     >> y = int(t^2) % note: as rzrgenesys187 says, this is t^3/3
    
     y =
    
     t^3/3
    
     >> x = 1:10; % same as x = [1:1:10]            
     >> subs(y, 't', x)   
    
     ans =
    
      Columns 1 through 7
    
         0.3333    2.6667    9.0000   21.3333   41.6667   72.0000  114.3333
    
       Columns 8 through 10
    
       170.6667  243.0000  333.3333
    

    If you want to make the expression y(x) behave like function invocation, you can bind the variable y using an anonymous function:

     >> y = int(t^2);         
     >> y = @(t) subs(y, 't', t); % the 't^3/3' value of y gets bound into the anonymous function
     >> y(x)
    
     ans =
    
       Columns 1 through 7
    
         0.3333    2.6667    9.0000   21.3333   41.6667   72.0000  114.3333
    
       Columns 8 through 10
    
       170.6667  243.0000  333.3333
    
     >> y(2)
    
     ans =
    
         2.6667
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

usually, symbolic functions return vectors for vector inputs: syms('x'); f=x*2; subs(f,[1 2 3]) outputs:
I have expanded sin function into a Taylor series. Now I want to evaluate
I'm trying to simplify some symbolic equations. >> syms x; >> simplify(sqrt(x^2)/x) ans =
I have this code: syms x y z f =[x^2+y^2+z^2-100 ,x*y*z-1 ,x-y-sin(z)]; v =
In MatLab, you can declare symbols pretty easily: syms a,b mat = [a,b] I'm
Hallo,friends we have the following problem syms t u0 u1 u0=sin(t); R1= diff(u0,'t',2)+u0-u0^3; u1=dsolve('D2u1+u1=R1','t')
I don't understand class_eval . class Module def attr_ (*syms) syms.each do |sym| class_eval
Let Q be a nx2 vector, which contains n (2-dimensional) coordinates. I want to
Hallo friends, I want to figure out the following problem: Suppose,we have expression like,
syms t theta chy sy real; A = [0 0 0 0; 0 -theta

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.