Ouputting data from a function to an array

Hi there,
I'm trying to output data from an sfit function to an array, so that I can use the surfnorm command. Basically I am receiving position data from Imaris, a 3-D visualization software and performing a surface fit. I am tasked with generating surface normals to the resulting surface (and I intend to use the surfnorm command). However, to create these normals, I need the xyz coordinates (in a particular range) from the resulting surface fit. How does one sequester the xyz coordinates for a surface fit (I'm using the thin plate spline interpolation)? Note--I already have turned the plotted function in the createfit function into a workspace variable called fitresult. However, whenever I open the variable in my command line, I receive the following answer.
Thin-plate spline interpolant:
fitresult(x,y) = thin-plate spline computed from p
where x is normalized by mean 3760 and std 185.2
and where y is normalized by mean 2812 and std 188.8
Coefficients:
p = coefficient structure
Thanks!
Cheers, Harsh

Answers (1)

dpb
dpb on 16 Jun 2014
... the xyz coordinates (in a particular range) from the resulting surface fit
You had to have the coordinates to do the fitting; use those. If you need to select a subset within the total, use logical addressing. Perhaps giving snippet of the fitting code to show variables and more specifically where you're stuck???

3 Comments

Hey dpb, many many many thanks for your swift reply!
Right now I'm just working off of the command line (I haven't wrote script yet to streamline the processing)--I'm fairly new to MATLAB programming. I am creating 3 workspace variables--x,y, and z. These are the imported coordinates from imaris. I then run the curve fitting toolbox to perform a surface fit. I just found out how to evaluate the surface fit function for all of my x and y values to output zfit values. However, now I'm stuck with the surfnorm command. Once I have my fitted surface coordinates, how can I generate the normals? I don't think I'm getting the syntax that MATLAB wants...
Once again, I really appreciate your help
this is effectively what I'm attempting to generate:

Sign in to comment.

Categories

Asked:

on 16 Jun 2014

Commented:

on 16 Jun 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!