If you run Simulink from the GUI menu, then variables for To Workspace blocks go in to the base workspace.
If you run Simulink by using the sim() command, then variables for To Workspace blocks go in to the workspace of the function that you call sim() in.
If you need to pull a variable out of the base workspace you can do that using evalin()
a = evalin('base', 'a');
b = evalin('base', 'b');