Jump to content

Manoj Kandukuri

Members
  • Content Count

    38
  • Joined

  • Last visited

About Manoj Kandukuri

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Country
    United States
  • Interests
    Numerical Computing, Machine learning
  • Are you University user?
    No

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Do you see 'fid' variable has a negative value ? if so, you might not have the 'nodes.txt' in the current working directory. can you please make sure you have the file in current working directory, if not change the working directory or have the fullpath to the file. like: fid =fopen('C:/temp/test.txt', 'r') thanks, Manoj kandukuri
  2. Hi Dung, you can get more accurate result by having a tolerance condition inside a while loop. something like below: %% clc, clear sum = 0; sum_before = realmax; tol = 1e-12; % tolerance value i = 0; while (abs(sum_before - sum) >= tol) i= i+ 1; sum_before = sum; sum = sum + 1/(i^2); end %% Hope this helps Thanks, Manoj kandukuri
  3. Please add the below lines on top in your zzz.py and it will do the trick. sys.path.append sets the path to import the files from the current folder. import sys sys.path.append('C:/Users/vkandukuri/Downloads') #change the path to the path where you have the files Thanks, Manoj kandukuri
  4. Hi Berker, As Python doesn't uses the plotting framework of OML, you can undock/dock the figure in python by using run_line_magic ipython api's set the positions and sizes. add below lines in your script to create pop up figure window from Python from IPython import get_ipython get_ipython().run_line_magic('matplotlib', 'qt') And to size the figure window you can use "matplotlib.rcParams['figure.figsize'] = (h, b)" where h and b are widow size. Note: get_ipython().run_line_magic('matplotlib', 'qt') undocks the figure window and get_ipython().run_line_magic('matplotlib', 'inline') docks the figure in command window. I have edited your python script as attached. hope this helps. If you want to have the plots inside OML only, then you can transfer the data from python back to Compose OML (by using getpythonvar command) and then plot inside OML. Did you try transferring of data back to OML from python and then do plotting inside OML? Thanks, Manoj kandukuri plot_test2_2.py
  5. Roberta, i just tried your suggestion, it didnt work. compose interpreted it as a string... Manoj kandukuri
  6. Hi Seoksan, you can save the plot to a variable and then set linewidth property for this variable.. clf; x = linspace(0,10,150); y = cos(5*x); h = plot(x,y,'b--o','linewidth',0.1); title('2-D Line Plot'); xlabel('x'); ylabel('cos(5x)') set(h, 'linewidth', 4) Manoj Kandukuri
  7. Thanks for your reply Jeff. I wanted to profile the functions used in oml scripts and their execution times in a report to improve the performance of the code. MK
  8. Is there a way to get list of functions (both inbuilt and user defined) used in .oml scripts? Thanks, MK
  9. Seoksan, I'm not sure why it didn't work but when i searched online, i found this is due to possible bug in axis('equal') - equal scaling by changing the limits when clf is refreshed, this causing the ylim changes to fade out. ( see https://github.com/matplotlib/matplotlib/issues/8093) Thanks, Manoj kandukuri
  10. Hi Seoksan, In the python file you have axis set to 'equal' and that is trying to make the axis limits to be equal. comment the line "plt.axis('equal')" and you can set the ylim and xlim as you requested. #plt.axis('equal') # axis limts plt.ylim(-4,2) plt.xlim(-1,5) Hope this helps MK
  11. Hi SeokSan, Meshgrid of x and y vectors would give you the rows of the output array X which are copies of the vector x; columns of the output array Y are copies of the vector y. in your 1st example: X values are replicates of vector x and Y values are replicates of vector y' (transpose of vector y), giving you X & Y as square matrices with data points representing in 2Dplane (something like Cartesian coordinates) So when you calculate z (in your 1st example) you're doing element-wise multiplication of sin(X) (which is x vector repeated Horizontally) and cos(Y) (which is y vector repeated vertically) in your 2nd example approach, while calculating c you're doing matrix multiplication of sin(a') (which is x vector repeated vertically) and cos(b) (which is y vector repeated Horizontally) which is not the same mathematical operation as your 1st approach. that is why you see 2 different graph's. so to achieve the same result with these 2 approaches; you need to surface plot of c' (transpose of matrix c) surf(a,b,c') or change the logic little bit a=[0:0.1:2*pi]; b=a'; c=cos(b)*sin(a); figure(2) surf(a,b,c) Hope this helps!
  12. Hi Ronald, I apologize for late reply.. I don't have an existing macro which does the same... Thanks, MK
  13. How to display a portion of a string as BOLD (for example : label ON) in uicontrol? han.text_label = uicontrol('Style', 'edit','string',{'label : on'},'FontSize',10,'fontweight','bold', 'Position', [1 100 200 30]); Thanks, Manoj Kandukuri
  14. Hi SeokSan, As stmaster suggested you can do undock/dock manually. And if you want to make the Float option as default, You can select/check the Float option in Preferences file. File> Preferences > plot> Float Thanks, MK
×
×
  • Create New...