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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:50:46+00:00 2026-05-31T00:50:46+00:00

Since MATLAB does not provide self-reference , what is the actual difference between a

  • 0

Since MATLAB does not provide self-reference, what is the actual difference between a static and a non-static method in MATLAB, apart from the latter not being call-able without a class instance? One always has to pass a reference to the object-to-be-modified anyway (edit apart from setters, getters and overloaded operators which implicitly include the self-reference)

  • 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-31T00:50:48+00:00Added an answer on May 31, 2026 at 12:50 am

    For non-static methods, Matlab provides the calling class as the first argument. By (personal convention) I call this argument self, which then emulates a self reference syntax. e.g.:

    methods (Static = false)
        function output = someMethod(self, arg1, arg2, arg3)
            self.x      %Now refers to the (potentially private) field `x`
            self.someOtherFunction(arg1, arg2) %Calls another method, which may be static or not.
        end
    end
    

    By contrast

    methods (Static = true)
        function output = someStaticMethod(arg1, arg2, arg3)
            %There is no input appropriate to the name "self" 
            someOtherFunction(arg1, arg2) %Calls another method, which must be static
        end
    end
    

    Given an object someObject, these methods can both be called by using:

    someObject.someMethod(arg1, arg2, arg3)
    someObject.someStaticMethod(arg1, arg2, arg3)
    

    The self-reference discussed in the linked question is referring to package names, which is an entirely different animal.

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

Sidebar

Related Questions

Coming from a non-OO background in Matlab, I'm looking to perform some of the
Since MATLAB is not good with loop, I am putting some of the looping
Since Graduating from a very small school in 2006 with a badly shaped &
Since Rails is not multithreaded (yet), it seems like a threaded web framework would
I am writing a cell array of string into Excel from Matlab. I have
Since there is no finally clause to the try-catch block in MATLAB, I find
I have learned a Machine Learning course using Matlab as a prototyping tool. Since
When starting the external program (let's call it EX for brevity) from within Matlab
package matlab; import com.mathworks.toolbox.javabuilder.*; import com.eigenface.Eigenface; public class Test { public static void main(String[]
You all here realy help me with matlab since i am a beginner. Now

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.