## Notes from 5/18/2012

*May 18, 2012 by Chris Johnson. Filed under nbsn.*

### Evaluating field

[B, T, eps] = get_param_combos(100);
[Bc2, Tc, Ic] = NbSn(T, B, eps);

### Stripping out complex numbers and NaNs

The critical current has some NaNs and complex numbers where we’re finding roots of negative numbers. MATLAB’s visualization functions don’t seem to tolerate these non-real values. I set all non-reals to 0 with:

Ic(find(real(Ic) ~= Ic)) = 0;
Ic(isnan(Ic)) = 0;

These two lines exploit the fact that find and isnan report the indices of matching elements. We index back into Ic with these vectors of indices and assign all identified elements the value 0.

I tried zeroing the complex numbers with

Ic(~isreal(Ic)) = 0;

but isreal returns a boolean, not the indices.

### 3-D Rotation

MATLAB’s 3-D rotation seems to work terribly in its default state. Rotating beyond a certain threshold causes the plot to flip. I was able to get what I felt was sane behavior with the following:

- Display the Camera Toolbar under the View menu.
- Choose Orbit Camera on the toolbar.
- Choose Principal Axis Y on the toolbar.

## Leave a Reply