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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:21:30+00:00 2026-06-17T08:21:30+00:00

I’m trying to do a script for nodal analysis for an arbitrary circuit(much like

  • 0

I’m trying to do a script for nodal analysis for an arbitrary circuit(much like spice).I want to import data from a text file and create a matrice on which further operations will be based on.
so I’ve used textscan

fid = fopen('text2.txt');
netlist = textscan(fid,'%s%s%d%d%d%d%f');

so for an input file like this:

R1 R 1 0 3 0 0 
C1 C 1 0 5 0 0 
L1 L 2 1 10 0 0 
R2 R 1 2 1 0 0 
i1 Iac 2 0 1 1 0.523

the result wil be this

 {5x1 cell}    {5x1 cell}    [5x1 int32]    [5x1 int32]    [5x1 int32]    [5x1 int32]
 [5x1 double]

the problem is, now I can’t call any individual value from the matrice. So I’m trying to figure out how to recreate the original matrice(if possible) and if that didn’t work, could you show me a way to call individual elements (like for example C in (2,2)?
Thanks in advance

  • 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-17T08:21:32+00:00Added an answer on June 17, 2026 at 8:21 am

    Cell arrays are simply another way to store data. Specifically, cell arrays are needed when each cell contains data of different type or different dimensions (in which case, using a matrix won’t work).

    To access an individual element in the cell array, you use curly braces ({}). After textscan your data is stored as columns, so you first access the i-th column by C{i}.

    Then you need to think what your cell contains. Column 2 contains strings, so it’s another cell array (you can also verify it in the result — column 2 is described as a {5x1 cell}). Therefore, you’ll need to use curly braces again. If you want to access the 2nd element in the 2nd column, you will have to write:

    C{2}{2}
    

    P.S.
    If you were to access the 2nd element in the 3rd column, you’d be using round braces () for the second subscript, because the second column is a vector. In such case, the syntax should be:

    C{3}(2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I am trying to render a haml file in a javascript response like so:
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to construct a data frame in an Rcpp function, but when I
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am using jsonparser to parse data and images obtained from json response. When
I am trying to understand how to use SyndicationItem to display feed which is

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.