Jump to content

Manoj Kandukuri

  • Content Count

  • Joined

  • Last visited

  • Days Won


Manoj Kandukuri last won the day on June 3

Manoj Kandukuri had the most liked content!

About Manoj Kandukuri

  • Rank
    Advanced Member

Profile Information

  • Gender
  • Interests
    Numerical Computing, Machine learning
  • Are you University user?

Recent Profile Visitors

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

  1. Hi Roberta, If your variable testvar is a cell datatype, and contains all the timestep information then you can use something like below for example testvar = {1,[],2,4,5,[],10} b = testvar(find(~cellfun(@isempty,testvar))) then your 'b' will be { [1,1] 1 [1,2] 2 [1,3] 4 [1,4] 5 [1,5] 10 } hope this helps thanks, Manoj
  2. Hi Debdatta, the if statement "dataTypeName==search" compares number of characters in both variables. That's the reason why the error raised. Instead use "strcmpi" which compares the characters itself in variables if strcmpi(dataTypeName,search) == 1 % 1 == logical yes if both variables are identical printf('Stress result found!') end thanks, Manoj
  3. There are multiple commands to extract CAE/Test data file in Compose OML. of which, readmultvectors, readcae commands extracts results of specific input arguments given by the user. I had multiple requests from users asking, as these 2 functions serve the same purpose then whats the difference between readmultvector & readcae? Which one do we use and when? As an engineer myself, I tried to break it down based on 2 key factors below: 1. Syntax differences (Ease of Use) 2. Speed/Performance Attached is the paper i wrote about the same with example. Hope this helps users to pick the right command for their tasks. Happy coding!! Thanks, Manoj kandukuri readmultvector_readcae_why_are_they_2.pdf
  4. Hi Debdatta, You can use "real" & "angle" commands to get magnitude and phase of fft signal real(ft) angle(ft) thanks, Manoj kandukuri
  5. Hi Batuhancoskun, As your variable 'str' is a string, you can get desired output by using indexing to get the "letters" form the string --> str(6:end) output: ForGeeks if you want to split a string at a desired character/delimiter you can use 'strplit', 'regexp' functions. Hope this helps
  6. Below is kind of a hack in 2019.2 1. set python as preferred language under file>preferences>Compose>General 2. open new python and OML files (to trigger OML command window) 3. close compose and relaunch you will see both OML and python interpreters.
  7. Hi Nils, you can use "set(gca,'xtick',7)" where 7 is number of ticks you want to have between the limits [0:t_sim]. hope this helps thanks, Manoj kandukuri
  8. 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
  9. 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
  10. 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
  11. 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
  12. Roberta, i just tried your suggestion, it didnt work. compose interpreted it as a string... Manoj kandukuri
  13. 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
  14. 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
  15. Is there a way to get list of functions (both inbuilt and user defined) used in .oml scripts? Thanks, MK
  • Create New...