Debug 路漫漫-02

MATLAB BTLModel 错误解析
本文针对MATLAB中实现BTLModel时遇到的典型错误进行了详细解析,包括数组维度不匹配、数据类型错误等问题,并提供了相应的解决思路。

 

重现标准 BTL Model ,using MATLAB:

1、

错误使用 cat
要串联的数组的维度不一致。
出错 cell2mat (line 83)
m{n} = cat(1,c{:,n});

—— cell2mat(...)括号里cell 必须符合每个行的维度相同。 

 

 

2、

错误使用 sum
数据类型无效。第一个参数必须为数值或逻辑值。

—— 

3、

无法执行赋值,因为左侧的大小为 62101-by-5,右侧的大小为 62101-by-1。
出错 BTL_baseline_v1>graded_solver (line 121)
U(userSet,:) = cell2mat(temp);

—— U(userSet,:) 与cell2mat(temp); 维度不一致。

 

 4、

无法执行赋值,因为左侧的大小为 1-by-1,右侧的大小为 1-by-2。
出错 BTL_baseline_v1>calVk (line 266)
eT(:,i) = u(:,i)./eT;

—— 

5、

没有为类 'cell' 的值定义函数 'subsindex'。
出错 BTL_baseline_v1>calVk (line 258)
u = U(sess(1,1),:);

——

6、

未定义与 'cell' 类型的输入参数相对应的函数 'log'。
出错 BTL_baseline_v1>graded_solver (line 160)
lh = sum(log(lh));

——  将    lh = cell2mat(lh); 进一步转化为 mat

 

7、

 

转载于:https://www.cnblogs.com/shenxiaolin/p/9460880.html

lloworld] [p-nio-80-exec-1] d.l.m.c.t.stdio.StdioMcpTransport : Starting process: [cmd, /c, npx, -y, @baidumap/mcp-server-baidu-map] 2025-08-02T16:58:34.500+08:00 DEBUG 10516 --- [langchain4j_helloworld] [p-nio-80-exec-1] d.l.m.c.t.stdio.StdioMcpTransport : PID of the started process: 6024 2025-08-02T16:58:35.619+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.619+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] ERROR: You must supply a command. 2025-08-02T16:58:35.619+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] Execute binaries from npm packages. 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] npx [options] <command>[@version] [command-arg]... 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] npx [options] [-p|--package <package>]... <command> [command-arg]... 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] npx [options] -c '<command-string>' 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] npx --shell-auto-fallback [shell] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] Options: 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --package, -p Package to be installed. [string] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --cache Location of the npm cache. [string] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --always-spawn Always spawn a child process to execute the command. 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] [boolean] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --no-install Skip installation if a package is missing. [boolean] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --userconfig Path to user npmrc. [string] 2025-08-02T16:58:35.659+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --call, -c Execute string as if inside `npm run-script`. [string] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --shell, -s Shell to execute the command with, if any. 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] [string] [default: false] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --shell-auto-fallback Generate shell code to use npx as the "command not 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] found" fallback. 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] [string] [choices: "", "bash", "fish", "zsh"] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --ignore-existing Ignores existing binaries in $PATH, or in the local 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] project. This forces npx to do a temporary install and 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] use the latest version. [boolean] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --quiet, -q Suppress output from npx itself. Subcommands will not 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] be affected. [boolean] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --npm npm binary to use for internal operations. 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] [string] [default: "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js"] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --node-arg, -n Extra node argument when calling a node binary.[string] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --version, -v Show version number [boolean] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] --help, -h Show help [boolean] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] 2025-08-02T16:58:35.660+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : [ERROR] For the full documentation, see the manual page for npx(1). 2025-08-02T16:58:35.668+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-2] d.l.m.c.t.stdio.ProcessIOHandler : ProcessIOHandler has finished reading output from process with PID = 6024 2025-08-02T16:58:35.668+08:00 DEBUG 10516 --- [langchain4j_helloworld] [ Thread-3] d.l.m.c.t.stdio.ProcessStderrHandler : ProcessErrorPrinter has finished reading error output from process with PID = 6024 2025-08-02T16:58:35.670+08:00 DEBUG 10516 --- [langchain4j_helloworld] [onPool-worker-1] d.l.m.c.t.stdio.StdioMcpTransport : Subprocess has exited with code: 1
最新发布
08-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值