Matlab script to rename signal name [closed] - matlab

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have simulink block which has thousands of input signal for example which contains a text TRXA
AIM1_Freshness_TRXA_FCC,
AIM2_Freshness_TRXA_FCC
I need to create exact replica of the model only change is TRXA is changed to TRXB
AIM1_Freshness_TRXB_FCC ,
AIM2_Freshness_TRXB_FCC
Any easy or matlab script to do that

Does the following help?
open_system('your_model')
x = find_system('RegExp','on','FindAll','on','Name','TRXA');
for idx=1:size(x,1)
name_orig = get_param(x(idx),'Name');
set_param(x(idx),'Name',strrep(name_orig,'TRXA','TRXB'));
end

Related

Odd signal not showing correctly in MATLAB [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
t=-10:0.001:10
x=sinc(t);
subplot(321)
plot(t,x)
title 'orignal sinc wave'
%x(-t)
a=sinc(-t);
subplot(322)
plot(t,a)
title 'negative'
b=(x+a)*1/2;
subplot(323)
plot(t,b)
title 'even part of the signal'
c=(x-a)*1/2;
subplot(324)
plot(t,c)
title 'odd part of the signal'
d=c+b;
subplot(325)
plot(t,d)
sinc(t) is a symmetric function, so x=sinc(t)=sinc(-t)=a, thus, your panel 4, c=(x-a)*1/2 yields exactly 0 for all t values.

Is it possible to plot bars with filled pattern in Matlab [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Is it possible to plot bars with filled pattern in Matlab, like this figure?
I attempted to use applyhatch_pluscolor link however, I couldn't make it work (attempt below). Is there an easy / feasible alternative?
Test code:
bar(rand(3,4));
[im_hatch,colorlist] = applyhatch_pluscolor(gcf,'\-x.',1,[],[],150);
Then I changed the source code, from bits = hardcopy(h,'-dzbuffer',['-r' num2str(dpi)]); to bits = print(h,'-RGBImage',['-r' num2str(dpi)]);.
I got the figure below. However, this is still far away form the desired result.

How to create a a:d:b vector to create and display "sin(0), sin(pi/n), sin((2*pi)/n), . . . , sin(2*pi)]" [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have been trying for a while to get this to work but I don't seem to be getting any closer to a solution.
I'm not sure of what the pattern is and what to write for the "d" value in a:d:b
Clearly you want to start from 0 (a) and go to 2*pi (b).
Now the question comes what is your step size (d)?
From your example you can see that you are changing from 0 to pi/n.
And from pi/n to 2*pi/n.
This means your step size is d=pi/n
Once you defined your n, e.g:
n=10;
you can do the rest like this:
x=0:(pi/n):(2*pi)
y=sin(x);

Multidisciplinary function handle in MATLAB [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I want to know is it possible to make multidisciplinary function handle in MATLAB and if possible, how can I do this.
I assume you mean a "multivariate function" since a "multidisciplinary function" is completely non-nonsensical.
f=#(x,y)x+y
f(3,2)
ans =
5

Is there a way to get a function to perform the same operation on a list of variables in MATLAB? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
E.g. I'd like to perform a command like blitzer(blitzer(:,4)<0.5,5) on a list of variables (or all the variables in the workspace) in MATLAB.
So I'd like to perform it on comet, dasher, etc...
Use the who function:
s = who;
for i = 1:length(s)
temp = eval(s{i});
answer{i} = temp(temp(:,4)<0.5,5);
end