Giuseppe Inghilterra
Politecnico di Milano
Followers: 0 Following: 0
Feeds
답변 있음
data replace with NaN
Hi, I would do in the following way: y(x>=2.519e6 & x<=2.52e6) = NaN; In this way I overwrite the current values of y vector ...
data replace with NaN
Hi, I would do in the following way: y(x>=2.519e6 & x<=2.52e6) = NaN; In this way I overwrite the current values of y vector ...
3년 초과 전 | 1
| 수락됨
문제를 풀었습니다
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.
대략 4년 전
문제를 풀었습니다
Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] then B = [ 1 1 5 ...
대략 4년 전
문제를 풀었습니다
Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...
대략 4년 전
문제를 풀었습니다
Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.
대략 4년 전
문제를 풀었습니다
Get the length of a given vector
Given a vector x, the output y should equal the length of x.
대략 4년 전
문제를 풀었습니다
Convert given decimal number to binary number.
Convert given decimal number to binary number. Example x=10, then answer must be 1010.
대략 4년 전
답변 있음
EPS export issue: blank figure
Hi, I usually export matlab figures in .svg format, then I modify them in inkscape and save it to .pdf. I add it in LaTex docum...
EPS export issue: blank figure
Hi, I usually export matlab figures in .svg format, then I modify them in inkscape and save it to .pdf. I add it in LaTex docum...
4년 초과 전 | 0
답변 있음
How to set specific variables in fmincon to be integers only?
Hi, another solution could be adding non linear equality constraints: for example remainder of division between first variable ...
How to set specific variables in fmincon to be integers only?
Hi, another solution could be adding non linear equality constraints: for example remainder of division between first variable ...
4년 초과 전 | 0
답변 있음
How to modify data vector
Hi, you convert to string your time vector (num2str function) and then convert it to date (datetime function), specifying input...
How to modify data vector
Hi, you convert to string your time vector (num2str function) and then convert it to date (datetime function), specifying input...
4년 초과 전 | 0
답변 있음
How to save each term from a sum
Hi, try to run this code. I add a plot in which I show how "pi1" converges toward to pi value. clear n = input('Number of ter...
How to save each term from a sum
Hi, try to run this code. I add a plot in which I show how "pi1" converges toward to pi value. clear n = input('Number of ter...
거의 5년 전 | 0
답변 있음
Print figure without its title
Hi, an easy and fast solution could be save first the figure and then add title, as following code: close all; clear all; cl...
Print figure without its title
Hi, an easy and fast solution could be save first the figure and then add title, as following code: close all; clear all; cl...
거의 5년 전 | 0
답변 있음
how to plot multiple graphs
Hi, you can plot all these figure by using a for loop cycle. Example: for ii = 1:180 figure plot(x,y) end In this...
how to plot multiple graphs
Hi, you can plot all these figure by using a for loop cycle. Example: for ii = 1:180 figure plot(x,y) end In this...
거의 5년 전 | 0
답변 있음
Protect the size of a preallocated matrix
Hi, in MATLAB numeric arrays are free to change size, i.e. if you add an element outside intial defined dimension, then array w...
Protect the size of a preallocated matrix
Hi, in MATLAB numeric arrays are free to change size, i.e. if you add an element outside intial defined dimension, then array w...
거의 5년 전 | 0
| 수락됨
답변 있음
Find rows of cell array containing certain specific multiple cells?
Hi, try to run following code, variable 'r' returns you row that contains what are you looking for: [r c] = find(strcmp(ca,'g'...
Find rows of cell array containing certain specific multiple cells?
Hi, try to run following code, variable 'r' returns you row that contains what are you looking for: [r c] = find(strcmp(ca,'g'...
거의 5년 전 | 0
| 수락됨
답변 있음
I want to double numbers that are less than the given parameter. What do I need to change
Your function will be: function dataSamples = AdjustMinValue(numberSamples, userSamples, minValue) % numberSamples: Number of ...
I want to double numbers that are less than the given parameter. What do I need to change
Your function will be: function dataSamples = AdjustMinValue(numberSamples, userSamples, minValue) % numberSamples: Number of ...
거의 5년 전 | 0
답변 있음
Reading all text from specific cell from .csv file.
Hi, try to run following code, you should obtain what you have asked: close all clear all clc filename = 'dtc_table.csv';...
Reading all text from specific cell from .csv file.
Hi, try to run following code, you should obtain what you have asked: close all clear all clc filename = 'dtc_table.csv';...
거의 5년 전 | 0
| 수락됨
답변 있음
How merge block works in simulink?
For merge block see reference: https://www.mathworks.com/help/simulink/slref/merge.html However, if you try to model as merge_b...
How merge block works in simulink?
For merge block see reference: https://www.mathworks.com/help/simulink/slref/merge.html However, if you try to model as merge_b...
거의 5년 전 | 1
답변 있음
Why is my scatter plot producing inconsistent results?
Hi, your code is correct. ev17 and sch17 have the same value (2631). Both are plotted with diamond marker, thus they are superi...
Why is my scatter plot producing inconsistent results?
Hi, your code is correct. ev17 and sch17 have the same value (2631). Both are plotted with diamond marker, thus they are superi...
거의 5년 전 | 1
답변 있음
Schröder number with formula
I show you how you could solve your problem. Try this code: prompt = 'n: '; n = input(prompt); % ask the user for a...
Schröder number with formula
I show you how you could solve your problem. Try this code: prompt = 'n: '; n = input(prompt); % ask the user for a...
거의 5년 전 | 0
답변 있음
write indexes in a plot
Hi, look this answer: https://www.mathworks.com/matlabcentral/answers/97277-how-can-i-apply-data-labels-to-each-point-in-a-scat...
write indexes in a plot
Hi, look this answer: https://www.mathworks.com/matlabcentral/answers/97277-how-can-i-apply-data-labels-to-each-point-in-a-scat...
거의 5년 전 | 0
| 수락됨
답변 있음
Random specified numbers.
Hi, you can use randsample matlab function. (Reference: https://www.mathworks.com/help/stats/randsample.html). y = randsample...
Random specified numbers.
Hi, you can use randsample matlab function. (Reference: https://www.mathworks.com/help/stats/randsample.html). y = randsample...
거의 5년 전 | 0
답변 있음
Random variation in a signal in Simulink
Hi, if you can use stateflow in your simulink model, following chart could be a solution: As you can see you start from stat...
Random variation in a signal in Simulink
Hi, if you can use stateflow in your simulink model, following chart could be a solution: As you can see you start from stat...
거의 5년 전 | 0
| 수락됨
답변 있음
How to make real and imaginary plot of the graph same color
Hi, a fast and easy solution could be generate a triplette of RGB values randomly at each iteration and you use it as color fo...
How to make real and imaginary plot of the graph same color
Hi, a fast and easy solution could be generate a triplette of RGB values randomly at each iteration and you use it as color fo...
거의 5년 전 | 1
| 수락됨
답변 있음
How to simulate a random castle in a chessboard?
Hi, if you try to run this code: close all clear all clc n = 8; %chessboard size CB = zeros(n,n); %init ...
How to simulate a random castle in a chessboard?
Hi, if you try to run this code: close all clear all clc n = 8; %chessboard size CB = zeros(n,n); %init ...
거의 5년 전 | 0
| 수락됨
답변 있음
How to plot fixed value for a number of ranges splited by a fixed step size in MATLAB?
Hi, you can obtain your plot by using 'bar' matlab function (reference: https://www.mathworks.com/help/matlab/ref/bar.html). F...
How to plot fixed value for a number of ranges splited by a fixed step size in MATLAB?
Hi, you can obtain your plot by using 'bar' matlab function (reference: https://www.mathworks.com/help/matlab/ref/bar.html). F...
거의 5년 전 | 0
| 수락됨