Community Profile

photo

Clayton Gotberg


Last seen: 11ヶ月 前 2019 年からアクティブ

I'm a graduate student in mechanical engineering and robotics with a penchant for solving logic problems (both in code and for fun). I'm glad to be giving back to the community that got me through undergrad!

統計

All
  • MATLAB Central Treasure Hunt Finisher
  • Knowledgeable Level 4
  • First Answer
  • Solver

バッジを表示

Content Feed

表示方法

回答済み
Array indices must be positive integers or logical values
I tried the same code letter for letter and I was able to make it work. Are you on the Windows OS? Also, since you're using R20...

3年弱 前 | 0

回答済み
Saving matrices as separate files in for loop
You need to specify the variables to be saved as strings or characters, too. save(['output_dir/transformed_' num2str(i) '.mat']...

3年弱 前 | 0

| 採用済み

回答済み
App Designer Plot Multiple Graph
I believe the reason it is overlapping each time is that your plot function only refers to y on each loop. When you only provide...

3年弱 前 | 1

回答済み
Problems with changing the order of a binary representation
Use the fliplr function to swap the direction of arrays! NJ=3 for i = 1:2^NJ-1 binary_save(i,:) = fliplr(dec2bin(i,NJ)); ...

3年弱 前 | 1

| 採用済み

回答済み
Problem - vectors must be the same size
I've reformatted the code in your question to help myself understand it. function [D]=AH(nr,AAG,s) for y=1:nr xx...

3年弱 前 | 0

| 採用済み

回答済み
Diagonal of non-square matrix
n = 5; % Example input diagonals = [2 3 4]; % Method 1: matrix = zeros(n,n+2); % Preallocate for speed extra_zeros = zeros...

3年弱 前 | 0

回答済み
Thermocouple find voltage vs. temperature
You're trying to make a calibration curve for your thermocouple, so you should know the temperature at two calibration points. D...

3年弱 前 | 0

| 採用済み

回答済み
Read from multiple excel files and write into single excel file
Your two solutions have errors because: 1) In the first one, you overwrite data in each loop, then ask it to save when it has f...

3年弱 前 | 0

回答済み
How to plot this signal x(𝑡) = (𝑡 + 2)𝑢(𝑡 + 2) − 2𝑡𝑢(𝑡) + (2(𝑡 − 4) + 2)𝑢(𝑡 − 4)?
One error is in the line xt = (t+2)*u(t+2)-(2*t*u(t))+((2*(t-4)+2)*u(t-4)); and it is happening because of problems with the s...

3年弱 前 | 0

| 採用済み

回答済み
How to convert data sample with size 58 x 32 into matrikx 4x4
If I understand your new message correctly, you want to get all of the possible 4x4 matrices from this 56x32 matrix. In that cas...

3年弱 前 | 0

| 採用済み

回答済み
Multiple answers into single array
This is definitely possible! Since you aren't using integers for indexing, there are a couple of ways to do it: theta = linspac...

3年弱 前 | 0

| 採用済み

回答済み
MATLAB code for simulated Roomba to detect randomly generated obstacles
This is a fascinating project but offering much help with the code probably means you're going to need to go into more detail ab...

3年弱 前 | 0

| 採用済み

回答済み
Coding to extract specific files from two original folders into a new folder
You can use movefile or copyfile to put files in one place into another. This is a sketch of the code, you'll need to change ...

3年弱 前 | 1

回答済み
Why do I get Matrix dimensions must agree? I am trying to plot the frequency response of this function.
X = (1/(1-exp(-j.*w)))*(sin(1.5.*(w))./sin(w./2))+5*pi*dirac(w); % ^ % This is your problem! When MATLAB sees a scalar b...

3年弱 前 | 1

| 採用済み

回答済み
I am trying to plot a contour graph with with x,y and z points
It sounds like the problem is that you haven't made these functions into a grid. You started with x and y, then found z as a fu...

3年弱 前 | 0

回答済み
How to get tf() to display as a figure to use in a report?
I'm not sure if there's a specific function, but as a workaround you can try the below code in a MATLAB Live Script. syms s [n...

3年弱 前 | 0

| 採用済み

回答済み
How to install a Matlab package offline?????
Normally. when you download a support package, you actually download the basic information needed for MATLAB to grab the the act...

3年弱 前 | 0

| 採用済み

回答済み
stem command working on the oppisite side of the axis
This is because you haven't provided any information about the baseline for stem, so the function assumes you want it to come fr...

3年弱 前 | 0

回答済み
Mode identification on a Graph.
It looks like you already have the code to find out where the divisions should be. In that case, all that remains to be solved i...

3年弱 前 | 1

| 採用済み

回答済み
Push switch with Arduino
If you have the Arduino support package, you can directly read the values of the digital I/O pins. After that, it's a matter of ...

3年弱 前 | 0

| 採用済み

回答済み
How to shift a graph relative to other graph plotted on same axes in app designed by matlab app designer??
The answers here explain how to make a slider in the GUI which updates the figure whenever the slider position changes, instead ...

3年弱 前 | 0

| 採用済み

回答済み
Symmetric Matrix-Vector Multiplication with only lower triangular stored
If is a symmetric matrix and is the lower triangular part of the matrix and is the upper triangular part of the matrix: w...

3年弱 前 | 2

回答済み
code for calculate points
The code you've already written will calculate those values for each of 121 points. for n = 1:nfreq T1=[B(n) C(n);D(n) H(n...

3年弱 前 | 0

| 採用済み

回答済み
Generating a text file and autofill it with outputs
Yes! fid = fopen('output_file.txt','wt'); % Open output_file.txt % 'w' means overwrite everything that is already in the file,...

3年弱 前 | 0

| 採用済み

回答済み
Finding Connected Component in the graph.
Have you looked at the functions available for graphs (see the 'Object Functions' section) in MATLAB? It appears that conncomp w...

3年弱 前 | 1

回答済み
how to calculate the geometric feature of wBC using matlab
Try out the regionprops command. Area, centroid, circularity and perimeter are all possible outputs for the function. stats = r...

3年弱 前 | 0

回答済み
Running multiple Matlab commands in only one terminal from command prompt
On Linux I'm able to do exactly what you want with the -nodesktop -nosplash -nojvm options - it takes over the terminal window t...

3年弱 前 | 0

回答済み
How to find the pair of divisors which are closest in value for a non-prime number? If prime, how to do this for the next largest non-prime?
If you're not dead-set on your method for determining the number of tiles in a subplot, how about using the square root of the i...

3年弱 前 | 2

| 採用済み

回答済み
How to use function "setBlockParameter" to set the parameter of Simulink block "prismatic joint"?
I believe the issue is that the parameter name is simpler than the path you've typed. For ease of reading, a lot of the paramete...

3年弱 前 | 0

| 採用済み

回答済み
Please, help with Matlab code
I really like your first longestword function. function out = longestword(word1, word2, word3) % Matlab function that takes as...

3年弱 前 | 0

さらに読み込む