Jump to content

SIJO GEORGE

Members
  • Content count

    7
  • Joined

  • Last visited

About SIJO GEORGE

  • Rank
    Newbie

Profile Information

  • Country
    India
  • Are you University user?
    No

Recent Profile Visitors

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

  1. SIJO GEORGE

    Include compose functions

    Hello Matthieu, You can call the function using function name along with input arguments. I have the following function (test) which does the addition of two input numbers. function out = test(a,b) out = a+b; end Way of calling the function: test(1,3) out = test(1,3)
  2. SIJO GEORGE

    Plot

    Hi, Use the following code for the problem you have mentioned above. Thanks Sijo George %%------Code----------------- sigma_inf=100; a=10; theta=pi/2; r=[0:10:100]; for i = 1:length(r) sigma_rr(i) = (((sigma_inf/2)*(1-(a/r(i))^2))+(sigma_inf/2)*(1-4*(a/r(i))^2+3*(a/r(i))^4))*cos(2*theta); end for i = 1:length(r) sigma_theta(i) =(((sigma_inf/2)*(1+(a/r(i))^2))-(sigma_inf/2)*(1+3*(a/r(i))^4))*cos(2*theta); end plot(r,sigma_theta); xlabel('Radius(m)'); ylabel('Sigma_Theta')
  3. SIJO GEORGE

    Plot

    It is because theta has only 16 elements. All variables must have equal number of elements. If you change the number of elements in theta, you must make the corresponding changes in 'r' also. Otherwise plotting and other operations will not take place. Thanks Sijo George
  4. SIJO GEORGE

    Plot

    Hi Novak, The following code works for me. I made the following changes. 1) Used for loop 2) Removed sigma_theta from the last line. This is because plot3 command accepts only three inputs. 3) Used linspace command to include the radius range. Thanks Sijo George %%%%----Updated code sigma_inf=100; a=10; theta=[0:0.1:pi/2]; r = linspace(0,100,16); for i = 1:length(r) sigma_rr = (((sigma_inf/2)*(1-(a/r(i))^2))+(sigma_inf/2)*(1-4*(a/(i))^2+3*(a/r(i))^4))*cos(2*theta); end for i = 1:length(r) sigma_theta =(((sigma_inf/2)*(1+(a/r(i))^2))-(sigma_inf/2)*(1+3*(a/r(i))^4))*cos(2*theta); end plot3(theta,r,sigma_rr);
  5. SIJO GEORGE

    Plot

    Hi Novak, I have made some changes in the code and it works fine for me. The 3-D plot is attached with this reply. The updated code is given below. The errors you made is also mentioned here. 1) Syntax theta=[0:0:pi/2]; is wrong 2) There is no need to mention @(theta) in Line no.5 and Line.no.6. 3) Use plot3 for obtaining 3-D plot. Thanks Sijo George %%-----Updated Code sigma_inf=100; a=10; r=10; theta=[0:0.1:pi/2]; sigma_rr = (((sigma_inf/2)*(1-(a/r)^2))+(sigma_inf/2)*(1-4*(a/r)^2+3*(a/r)^4))*cos(2*theta); sigma_theta =(((sigma_inf/2)*(1+(a/r)^2))-(sigma_inf/2)*(1+3*(a/r)^4))*cos(2*theta); plot3(theta,sigma_rr,sigma_theta);
  6. SIJO GEORGE

    Edit plots compose

    Hi, 1) For now, there is no command to set the font size of the legend through the script. This facility will be introduced in the future release of Compose. 2) The second problem is solved in the coming release of Compose (2017.3 build) will be be delivered by the end of this October. Thank you
  7. SIJO GEORGE

    SolidThinking Compose read files

    The following code gives a description of how to read data line by line in sT Compose. file = 'small_indian_train_data.csv'; fid = fopen(file,'rt'); counter = 0; % read file line by line while ~feof(fid) counter = counter + 1; line = fgetl(fid); sprintf('line %d in %s: %s',counter,file,line) end fclose(fid);
×