Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matlab to Python
#1
Photo 
Dear Python Users,

I am new to python. I am using Jupyter notebook for simulations.

Could you please help me to read out the output table generated in the
simulation

I am able to do it in Matlab but I want to do it in Jupyter notebook. I am
attaching the matlab code and output table for reference.

clear;
A=xlsread('table.xlsx');

for row=2:size(A,1)
   s=1;
for i=6:202
    if A(row,i)*A(row,i+1)<0
        x1(row,s)=i;
        s=s+1;
    end
    if s>2
        dia(row)=x1(row,2)-x1(row,1);
        break;
    end
end
t(row)=A(row,1);
end
plot(t, dia)
And how to save these values in the same output table?

Best regards

Sateesh
Larz60+ write Nov-04-2020, 11:55 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Added for you this time, please use bbcode tags on future posts
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  From Matlab to Python erbab 1 611 Oct-27-2020, 02:16 PM
Last Post: jefsummers
  Arrays in MATLAB and PYTHON cokhuatlanyeuthuongconhetmuc 2 740 Jul-24-2020, 10:47 AM
Last Post: cokhuatlanyeuthuongconhetmuc
  Matlab to Python -- Parallel Computing zistambo 1 772 Jun-10-2020, 04:59 PM
Last Post: pyzyx3qwerty
  Python v MatLab for graphs and plots CynthiaMoore 4 1,183 Apr-22-2020, 02:13 PM
Last Post: CynthiaMoore
  python equivalent to MATLAB xcov chai0404 2 1,638 Apr-02-2020, 10:29 PM
Last Post: chai0404
  Python equivalent of Matlab code kwokmaster 1 1,461 Mar-25-2020, 10:14 PM
Last Post: j.crater
  MATLAB to Python conversion stokd 10 2,179 Jan-19-2020, 09:14 PM
Last Post: stokd
  Help converting MATLAB triple-for loop to Python davlovsky 1 872 Oct-29-2019, 10:26 PM
Last Post: scidam
  Error -3 when opening matlab file in python python_newbie09 0 1,062 Aug-02-2019, 11:51 AM
Last Post: python_newbie09
  How can I save Python dictionaries in Matlab? jlostinco 1 1,333 Jul-04-2019, 11:35 PM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020