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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:06:53+00:00 2026-06-12T02:06:53+00:00

In every other language if I have a matrix, if I call a mono-dimensional

  • 0

In every other language if I have a matrix, if I call a mono-dimensional index, the result will be an array.I don’t know why in Matlab if you take a single index of a matrix, you’ll get a single element, that’s stupid.
Anyway in C:

mat[4][4];

mat[0] is an array.

In Matlab:

mat=[1 2; 3 4];

How do I take the first row of the matrix? mat(1) is 1, not [1 2].

EDIT: There is another problem, I have a problem with this function:

function str= split(string, del)

index=1;
found=0;

str=['' ; ''];

for i=1:length(string)
    if string(i)==del
        found=1;
        index=1;
    elseif found==1
        str(2,index)=string(i);
        index=index+1;
    else
        str(1,index)=string(i);
        index=index+1;
    end
end

end

This returns sometimes a matrix and sometimes an array.
For example if I use split(‘FF’,’.’) I get ‘FF’ as result, but what if I want to return a matrix? I can’t even choose the dimensione of the matrix, in this context a weak typed language is a big disvantage.

  • 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-12T02:06:54+00:00Added an answer on June 12, 2026 at 2:06 am

    You have to say which columns you want. : stands for all indices in a dimension, so to take first row

    mat(1,:)
    

    It is not stupid, but useful. If you address a matrix with only one index, it implicitly gets converted to a vector. This gives you the option to use linear indices (see sub2ind).

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

Sidebar

Related Questions

I will choose Java as an example, most people know it, though every other
The app will run fine, then crash - literally every other time. It seems
From the Xcode Docs : Syntax highlighting, code completion, and every other index-driven feature
My doc strings have references to other python classes that I've defined. Every time
Every programming language I know (Perl, Javascript, PHP, Python, ASP, ActionScript, Commodore Basic) uses
I have a function for language (like the system that Wordpress and other CMSes
This works in chromium (and I assume every other major browser) -html- <invalid></invalid> -css-
I'm trying to mimic what every other tabular view does with the DataGridView control,
while using beautifulsoup to parse a table in html every other row starts with
The CSS3 transition effect on this page works perfectly well on every other browser

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.