Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Mikko  
#1 Posted : 19 March 2018 13:11:17(UTC)
Mikko

Rank: Newbie

Groups: Registered
Joined: 03/10/2016(UTC)
Posts: 4
Finland

I'm trying to make a function return a value from a matrix by running a small for-loop inside the function. How should I write it? Couldn't find examples how to use it.

Screenshot 2018-03-19 12.06.16.png

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline bdrunagle  
#2 Posted : 19 March 2018 13:49:55(UTC)
bdrunagle


Rank: Member

Groups: Registered
Joined: 18/05/2010(UTC)
Posts: 27
Man
United Kingdom

Was thanked: 13 time(s) in 6 post(s)
Hi Mikko

The loop syntax needs tweaking, and the output variable needs to be defined. The attached file works for me.

kertoimetTest.sm (5kb) downloaded 90 time(s).

Hope this helps.

Brian
thanks 2 users thanked bdrunagle for this useful post.
on 19/03/2018(UTC),  on 19/03/2018(UTC)
Offline Mikko  
#3 Posted : 19 March 2018 14:29:34(UTC)
Mikko

Rank: Newbie

Groups: Registered
Joined: 03/10/2016(UTC)
Posts: 4
Finland

Thank you!!!

Good
Mikko

Edited by moderator 08 April 2018 13:56:28(UTC)  | Reason: marked as SOLVED

Offline ola_nicolas  
#4 Posted : 19 March 2018 15:53:50(UTC)
ola_nicolas


Rank: Advanced Member

Groups: Registered
Joined: 21/11/2017(UTC)
Posts: 114
Romania
Location: Olt county

Was thanked: 1 time(s) in 1 post(s)
Greetings

I have not been able to understand the purpose for which the imagined algorithm is used. As the question arises, it is a case of express identification of a certain value in the "kertoimet" matrix. In this case in 99.99 (9 ...) of cases, the result will be an error. If so then you can avoid ambiguity using the first procedure (case identification) in the attached file. Looking at the problem in terms of practical use, in the first column of the "kertoimet" matrix there are some non-dimensional coefficients corresponding to circular x-ray surfaces with the area expressed in square millimeters. In this case, a linear interpolation of these coefficients would be useful depending on the radius of the circle, and the procedure is the one presented in the case of interpolation.

Imagination.sm (7kb) downloaded 32 time(s).
Offline Jean Giraud  
#5 Posted : 20 March 2018 00:16:29(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... sorry: I understand nothing in there. Too few information.
Yes, you can best fit a circle from few points [not done in Smath]

Disk.PNG
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.