Answered
I try to run a for loop to plot the function y(t) for 0.1<=t<=0.9 for 5 diffrent t. Can you help me with my code?
You were pretty close. I had to change the loop to loop over the elements of t and save y one row at a time using y(i,:) using ...

4 years ago | 0

| accepted

Answered
I hope to show that aliasing occurs for more than one sinusoid
Perhaps you are looking for something like this? t = 0:1/500:0.02; x = 3*cos(2*pi*300*t+pi/3) + 8*cos(2*pi*800*t-pi/5); plot(...

4 years ago | 0

| accepted

Answered
How to append a string to a filename when saving a file?
This should get you closer to what you want to do [~,f,ext] = fileparts(files(id).name); % extract file name without original e...

4 years ago | 1

| accepted

Answered
How to use MATLAB RGB triplets and hexadecimal color codes for a custom plots?
I don't think you can specify name/value pairs in the plot command with multiple x/y values. This isn't very elegant but it d...

4 years ago | 1

| accepted

Answered
Cutting a Circular Ring at particular points using angle-theta
You were pretty close. See if you can adapt this to get what you want. p = linspace(-1/2,1/2,100); [X,Y] = meshgrid(p,p); % b...

4 years ago | 0

| accepted

Answered
How do I rename variables from workspace for multiple matfiles?
clearvars load('filename.mat') % load data that you want to change (replace filename with actual name of your file) img_ldct=i...

4 years ago | 1

| accepted

Answered
How to remove GIT from my Matlab files
Try Preferences>General>SourceControl, set Source control to None.

4 years ago | 6

| accepted

Answered
how to adjust x-axis in plot
I think this is what you are asking for. Note that this isn't going to be very pretty if you have more than a couple of months ...

4 years ago | 0

Answered
How to model a ramp input with two slopes and saturation at zero?
One approach (no loops necessary) t=0:0.1:50; y = zeros(size(t)); y(t<10) = 0.1 * t(t<10); y(t>=10) = 1 - 0.5 * (t(t>=10) - ...

4 years ago | 0

Answered
Can I have round corners with PATCH?
Try this. Adjust the 'curvature' value to adjust the ratio of the round corners to the size of the rectangle (1.0 will result i...

4 years ago | 1

Answered
Miraculous behavior of readstruct() when importing Attributes with a single d or e
@Eleftherios Bethmage As @AndresVar says, just use a text editor to search and replace CRC32=" with CRC32="0x. Or, as you sugg...

4 years ago | 1

Answered
Italicise axis ticks (latex)
Try changing V_i = {' ','u','v','w'}; to V_i = {' ','\textit{u}','\textit{v}','\textit{w}'}; % latex code for italics and c...

4 years ago | 0

| accepted

Answered
Need to plot points
It isn't pretty but this is the closest I could come up with to reproducing what you appear to want. x =[ 1 2 3 4 10 1 2 3...

4 years ago | 1

Answered
How to flip non-zero elements of an array and keep zero elements at initial position?
Another possibility (still requires a loop): A = [ 134 159 122 175 126 0 0 151 170 189 196 0 ...

4 years ago | 0

| accepted

Answered
How could I display a "circle at the bottom of the figure? And color it along the way? To show Hue angles?
As I mentioned in my comment to @Image Analyst's answer, surface may be what you want. I decided to experiment with it and came...

4 years ago | 0

Answered
shadow in mulitple line plot
I would recommend reading the documentation for the fill command: https://www.mathworks.com/help/matlab/ref/fill.html I think i...

4 years ago | 0

Answered
Put name on above and left
This is close to what you can do with a table. However, since you only have four columns in your data array, I don't understand...

4 years ago | 0

Solved


01 - Scalar variables
Create the following variables: <<http://samle.dk/STTBDP/Assignment1_1.png>>

4 years ago

Answered
What's going on when setting these parameters?
That sets the increment for the x vector. Read the documentation for the colon operator: colon

4 years ago | 0

Answered
Why is one of my subplots being deleted?
If you know the position of the two axes already, you don't need to use the subplot function to position them for you. Just do ...

4 years ago | 0

| accepted

Answered
I'm new to MATLAB. How would I read data and depending on line content, either read the line and parse it or skip it entirely? Should I use textscan ? fgetl?
fgetl() is probably a good way to do this. If you want to keep only the lines that start with numbers you could try something l...

4 years ago | 0

| accepted

Answered
How to extract the DateTime info of an image using Matlab?
On line 34 you are extracting the first character from tme and assigning it to strTime. Why? Try just using tme when you popul...

4 years ago | 0

| accepted

Answered
Legend Title Indexing - Keeps Overwriting
One approach that should work is to wait to generate the legend until after the loop is done. Replace the two lines stringTmp ...

4 years ago | 0

Answered
Write a function that gives a tree with one input
n = 9; tree(9); function tree(n) for i = 1:n fprintf('%s', repmat(' ', 1, n-i)); fprintf('%s\n', repmat...

4 years ago | 1

Answered
Finding Corresponding X Value for Y value
If you ask for two outputs from the max() function you can find the index of your peak: P=zeros(1,750); theta=zeros(1,750); L...

4 years ago | 0

| accepted

Answered
Yaw in mobile app
Typically, Azimuth is equivalent to Yaw (also Heading).

4 years ago | 0

Answered
How to pass commandline arguments to external text editor?
I don't have access to Matlab at the moment so I can't test this, but perhaps you can create a .bat file similar to this and put...

4 years ago | 0

| accepted

Answered
How can find the sum of these numbers using for-loop?
@Kim Kiha Have you read the documentation? Here is a link for the for loop documentation: https://www.mathworks.com/help/matl...

4 years ago | 0

Answered
What is the meaning of this code snippet?
What that looks like it is trying to do is to check to see if the caller provided an optional argument and setting the variable ...

4 years ago | 0

Answered
how to find zero value with find
Matlab will index down the columns first. It appears that you want to go across the rows first. So, just transpose the matrix....

4 years ago | 1

Load more