当我在命令窗口输入以下语句时,我一直在使用Matlab进行操作并输出相同的输出:
public class PocStateMachine : MassTransitStateMachine<PocSaga>
{
public PocStateMachine()
{
InstanceState(x => x.CurrentState);
Event(() => StartSaga);
Event(() => LoopMessageEvent);
Initially(
When(StartSaga)
.Then(context => {
Trace.TraceInformation("[SAGA] StartSaga recebido, saga criada e mudandando estado para Active - {0}",context.Data.CorrelationId);
Trace.TraceInformation("[SAGA] [StartSaga] -- {0} ---- {1}", context.Instance.CorrelationId, context.Data.CorrelationId);
})
.TransitionTo(Active),
When(LoopMessageEvent)
.Then(context =>
{
Trace.TraceInformation("[SAGA] - [Initially] LoopMessageEvent recebido - {0}", context.Data.CorrelationId);
}).TransitionTo(Active)
);
WhenEnter(Active,
x => x.Then(context => Trace.WriteLine("[SAGA] Entering Active State"))
);
WhenEnter(Processing,
x => x.
Then(context => Trace.WriteLine("[SAGA] Entering Processing"))
);
During(Active,
When(LoopMessageEvent)
.Then(context => Trace.TraceInformation("[SAGA] LoopScheduleMessage recebido, transicionando para Processing - {0}", context.Data.CorrelationId))
.TransitionTo(Processing)
);
During(Processing,
When(LoopMessageEvent)
.Then(context => Trace.TraceInformation("[SAGA] During Processing - LoopMessageReceived, Finishing()", context.Data.CorrelationId))
.Finalize()
);
SetCompletedWhenFinalized();
}
public State Active { get; private set; }
public State Processing { get; private set; }
public Event<StartPocSagaMessage> StartSaga { get; private set; }
public Event<LoopMessage> LoopMessageEvent { get; private set; }
}
public class LoopMessage : CorrelatedBy<Guid>
{
public LoopMessage(Guid jobId)
{
CorrelationId = jobId;
JobId = jobId;
}
public Guid JobId { get; set; }
public Guid CorrelationId { get; set; }
}
public class StartPocSagaMessage : CorrelatedBy<Guid>
{
public StartPocSagaMessage(Guid jobId)
{
CorrelationId = jobId;
JobId = jobId;
}
public Guid JobId { get; set; }
public Guid CorrelationId { get; set; }
}
public interface IStartPocMessage
{
Guid CorrelationId { get; set; }
}
public class PocSaga : SagaStateMachineInstance
{
public Guid CorrelationId { get; set; }
public State CurrentState { get; set; }
public Guid? ExpirationId { get; set; }
}
我无法在文档页面上找到有关此内容的任何参考资料。
答案 0 :(得分:7)
有two ways调用Matlab函数。
函数语法使用这样的括号,并且最通用,通过值传递参数:
[out1, out2] = funcname(arg1, arg2, arg3);
在命令语法中,没有括号,参数由空格分隔,参数假定为字符串(包含字符值的行向量)。
save mydata.mat x y z
您使用的命令语法不适合用作命令。因此,Matlab将一个字符串传递给floor
或ceil
,该函数强制参数转换为数字矩阵,然后函数不会进一步修改这些值,因为它们已经整数。
字符串'ans*ans'
中字符的ASCII值是,猜猜是什么,[ 97, 110, 115, 42, 97, 110, 115 ]
。