Unable to resolve this.scaledProject2 what causes this error?

G was used to create a tranfer function and it was used to plot the root locus but when pointing on the root locus the value of gain does not show, it says 'unable to resolve this.scaledProject2'

11 Comments

Not him, but really, this needs to be solved. Steps for reproduction:
  1. New Script
  2. Plot an rlocus
  3. Look for Gain at any point and behold "Unable to resolve the name 'this.scaledProject2'."
Code:
clc;
clear all;
close all;
%% SYS 1
num = [125];
den = [1 35 400 -1250];
sys1 = tf(num, den)
figure;
rlocus(sys1);
grid on;
%% SYS 2
z = [-2];
p = [-1 -1 -10];
k = 1;
sys2 = zpk(z, p, k)
figure;
rlocusplot(sys2);
grid on
Figures:
Works with R2025a, but it doesn't produce the legend. Which MATLAB version do you use ?
Do you have your own versions of "rlocus" and "rlocusplot" on your MATLAB path ?
What do you get if you type
which -all rlocus
/MATLAB/toolbox/control/ctrlobsolete/rlocus.m /MATLAB/toolbox/control/ctrldesign/@DynamicSystem/rlocus.m % DynamicSystem method
which -all rlocusplot
/MATLAB/toolbox/control/ctrldesign/@DynamicSystem/rlocusplot.m % DynamicSystem method
It sounds as if "this.scaledProject2" is a struct variable that you intended to create and reference when creating the legend, but somehow failed.
clc;
clear all;
close all;
%% SYS 1
num = [125];
den = [1 35 400 -1250];
sys1 = tf(num, den)
sys1 = 125 --------------------------- s^3 + 35 s^2 + 400 s - 1250 Continuous-time transfer function.
figure;
rlocus(sys1);
grid on;
%% SYS 2
z = [-2];
p = [-1 -1 -10];
k = 1;
sys2 = zpk(z, p, k)
sys2 = (s+2) -------------- (s+1)^2 (s+10) Continuous-time zero/pole/gain model.
figure;
rlocusplot(sys2);
grid on
I get this from the commands above:
/MATLAB/toolbox/control/ctrlobsolete/rlocus.m
/MATLAB/toolbox/control/ctrldesign/@DynamicSystem/rlocus.m % DynamicSystem method
/MATLAB/toolbox/shared/controllib/engine/+ltipack/@ltidata/rlocus.m % ltipack.tfdata method
/MATLAB/toolbox/control/ctrldesign/@DynamicSystem/rlocusplot.m % DynamicSystem method
So, apparently there is a miscommunication.
I did not create this legend; it belongs to rlocus itself and appears when you click on any point in rlocus.
This error started occurring in MATLAB Online. I do not know which version is being used, since it is not possible to select it.
This problem is not present in the 2024 versions of MATLAB, which is what I am currently using to avoid headaches, since it works as intended.
I don't think that this problem can be solved here.
I suggest you contact MATLAB Technical Support. If you allow them access to your PC, they can perform an effective search for the cause of the problem:
How does the legend look if you click on a point in rlocus for the 2024 versions of MATLAB ?
Ah, thanks for the suggestion. I think it must be some update they made, because until a few days ago, it was working correctly, which is weird.
The interface is more old school, but it shows the gain values in the 2024 version.
I am having this same problem in matlab online version. Whenever I plot some root-locus, it will not show the gain associated with some closed-loop pole location. Function rflocfind() is still working though. Any suggestion?
As already suggested: report the problem to MATLAB support:
I am having the same problem inside of a brand new installation of 2025b locally on a mac.
Same issue occurs in MATLAB Online (R2025b Update 1) when the mouse cursor is clicked at a specific location on the root locus.
I am also having the same issue. Was anyone ever able to figure out a solution?

Sign in to comment.

More Answers (1)

Hi,
Hi! I’ve seen this error before,'unable to resolve this.scaledProject2' , when trying to view the gain value by hovering over the root locus plot.
You can still get the gain values programmatically.
[r, k] = rlocus(G); % G is your transfer function
  • r is an MxN matrix of root locations (each column corresponds to a different gain).
  • k is a 1xN vector of gain values.
To find the gain for a specific root (or point) you’re interested in:
  1. Pick the (real, imag) coordinates of your point of interest.
  2. Find which entry in r is closest to your point.
  3. Use the column index of that entry to get the corresponding gain from k.
I hope it would resolve your query.

1 Comment

How to fix the problem so that you can see the gain on the graph?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!