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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:39:07+00:00 2026-06-17T06:39:07+00:00

I have data from simulations in one single .dat file. Depending on certain criteria

  • 0

I have data from simulations in one single .dat file. Depending on certain criteria (‘bu’) that is contained in one column of the file (#13 here), I want to plot the data with different markers, while also defining the markersize and markerface properties.
What I have is a switch environment for the different cases – defining which markers and properties I want, and all this in a for-loop, to go through all simulation data.

I’ve tried the following:

for i=1:s1(1)

bu = data1(i,13);

switch bu

    case 1
        set(h,'kd','MarkerSize',14,'MarkerFaceColor','k');
    case 2
        set(h,'kd','MarkerSize',14);
    case 3
        set(h,'k>','MarkerSize',14,'MarkerFaceColor','k');
    case 4
        set(h,'ks','MarkerSize',14,'MarkerFaceColor','k');
    case 5
        set(h,'ks','MarkerSize',14);
    case 6
        set(h,'ko','markersize',14);
    case 7
        set(findobj(gca,'k^','MarkerSize',14,'MarkerFaceColor','k'));    
end

figure(1);
h=plot(Re1(i),A1(i)); hold on
end

First I tried to use a handle ‘h’, but it said it was undefined, I guess since the h=plot comes later. Then I tried findobj in the last case (which is the case for the first simulation, so this gives the error in the first round), didn’t work either (“Incomplete property-value pair” – not sure what it means here).

I also tried putting all these properties in a string like

str=['kd','MarkerSize',14,'MarkerFaceColor','k']

then plot with

h=plot(Re1(i),A1(i),str); hold on

but it doesn’t work with/without brackets either.

Now I don’t have any further ideas, thankful for any suggestions!

  • 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-17T06:39:08+00:00Added an answer on June 17, 2026 at 6:39 am

    I think the easiest change for you is to put the plot options in a cell array in the switch block. For example:

    options = {'kd', 'MarkerSize', 14, 'MarkerFaceColor', 'k'};
    

    Later, when you plot:

    plot(x, y, options{:})
    

    Another way I’ve done it is to set variables and use them in the plot command:

    style = 'kd';
    markerSize = 14;
    markerFaceColor = 'k';
    plot(x, y, style, 'MarkerSize', markerSize, 'MarkerFaceColor', markerFaceColor);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data from two different sources that I need to combine. Some data
I have data from *.obj file. I know how draw with GL_TRIANGLES . How
I need to get some data from a column. For example I have data
I have this data from a xml file: <?xml version=1.0 encoding=utf-8 ?> <words> <id>...</id>
I have data from travel diaries which has been read in from a csv
I have data from tests with two lists of parts, called in and out.
I have data coming from an external system (in CSV form). The data contains
i have data below from streaming: 'ID|20120206|080500|0000001|0|1|record1|END' 'ID|20120206|080500|0000002|0|1|record2|END' 'ID|20120206|080500|0000003|0|1|record3|END' and i want to process
I have some data from log files and would like to group entries by
I have looped data from mysql, and it's a pretty long list. What's the

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.