ToSavedWorkspace Matlab script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: ToSavedWorkspace.m
  • Last update:
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • Language: Matlab
  • Price:Freeware
  • Company: Michael Robbins (View more)

ToSavedWorkspace script description:




Publisher review:
ToSavedWorkspace saves the workspace variables to the structure TOSAVEDWORKSPACE Saves the workspace to a structureThis trivial function saves all of the workspace variables to a structure.The intent of this script is to record the workspace variables before performing an operation on them, so as to keep them available after the operation for comparison.This code also has a built in test scaffold so it is an example of how to build self-testing code.TOSAVEDWORKSPACE returns a structure who's fields are all of the variables in the workspace.TOSAVEDWORKSPACE VARIABLES returns a structure who's fields are VARIABLES.TOSAVEDWORKSPACE -CLEAR returns a structure who's fields are all the variables in the workspace and then clears the workspace, leaving only the structure.TOSAVEDWORKSPACE -xVARIABLE returns a structure who's fields are all the variables in the workspace except VARIABLETOSAVEDWORKSPACE -xVARIABLE1 -xVARIABLE2 returns a structure who's fields are all the variables in the workspace except VARIABLE1 and VARIABLE2S = TOSAVEDWORKSPACE(...) returns a structure who's fields are all of the variables in the workspace.S = TOSAVEDWORKSPACE('-TEST') runs a test script.Example: Compare the workspace before and after executing an operationclear all; % start with a clean workspaceA = floor(10.*rand(1,100)); % generate some dataTSW = ToSavedWorkspace; % save the workspaceA = floor(A.*2); % perform an operationsetdiff(A,TSW.A) % compare the workspaceExample: Save the workspace and clear all variablesclear all; % start with a clean workspacea = rand(10); % create some variablesb = a.*2;c = ones(1,10);who % what's in the workspace?TSW=ToSavedWorkspace('-CLEAR'); % save the workspace & clearwho % only TSW is leftTSW % the previous workspace is in TSWExample: Save the variables a and b, but no othersclear all; % start with a clean workspacea = rand(10); % create some variablesb = a.*2;c = ones(1,10);TSW=ToSavedWorkspace('a','b'); % save a & bExample: Save all variables but bclear all; % start with a clean workspacea = rand(10); % create some variablesb = a.*2;c = ones(1,10);TSW = ToSavedWorkspace('-xb'); % save all but bExample: Save the variables a and c, then clear the workspaceclear all; % start with a clean workspacea = rand(10); % create some variablesb = a.*2;c = ones(1,10);TSW = ToSavedWorkspace( ... % save a & c then clear'a','c','-CLEAR');Example: Save the variables a and c, then remove cclear all; % start with a clean workspacea = rand(10); % create some variablesb = a.*2;c = ones(1,10);TSW = ToSavedWorkspace( ... % save a & c then clear'a','c');TSW % TSW has fields a and cTSW = rmfield(TSW,'c'); % eliminate field cTSW % TSW now only has field aExample: Compare two filesclear all; % start with a clean workspaceload('Test1'); % load a filet1=ToSavedWorkspace('-CLEAR'); % save & clear the workspaceload('Test2'); % load another filet2 = ToSavedWorkspace('-xt1'); % save the workspace, excluding t1keep t1 t2 % clear the workspace% Keep is by Xiaoning (David) Yang% and is available on the MATLAB% File Exchange Requirements: ยท MATLAB Release: R13
ToSavedWorkspace is a Matlab script for Development Tools scripts design by Michael Robbins. It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.

Operating system:
Windows / Linux / Mac OS / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5