Home > vbmeg > functions > tool_box > dynamics_movie > test_fig > basic_tool > movie_current_load.m

movie_current_load

PURPOSE ^

load current for creating movie

SYNOPSIS ^

function [Z, I] = movie_current_load(id, p)

DESCRIPTION ^

 load current for creating movie

 load parameters
 id.I_from : start vertex index
 id.I_to   : end vertex index

 2014-11-10 Masa-aki Sato
 2017-12-12 Yusuke Takeda

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    [Z, I] = movie_current_load(id, p)
0002 % load current for creating movie
0003 %
0004 % load parameters
0005 % id.I_from : start vertex index
0006 % id.I_to   : end vertex index
0007 %
0008 % 2014-11-10 Masa-aki Sato
0009 % 2017-12-12 Yusuke Takeda
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 
0015 load(p.curr_file, 'Z', 'ix_roi')
0016 
0017 % Convert from-index to index of Z
0018 NP = length(ix_roi);
0019 NM = max([ix_roi(:); id.I_from(:)]);
0020 ID = zeros(NM,1);
0021 
0022 % index convert table
0023 ID(ix_roi) = 1:NP;
0024 
0025 % convert from-index to index of Z
0026 I_from = ID(id.I_from);
0027 
0028 % exclude index outside of ix_roi
0029 I = find(I_from > 0);
0030 
0031 Z = Z(I_from(I),:);
0032 
0033 if length(I) < length(I_from),
0034     fprintf('There are mismatch between ix_roi and Index_from!!\n\n')
0035 end
0036 
0037

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005