Electrical characterization of nanostructures