photo

Voss


Last seen: Today Active since 2013

Followers: 3   Following: 0

Message

Statistics

All
  • MATLAB Central Treasure Hunt Finisher
  • Treasure Hunt Participant
  • Most Accepted 2023
  • Master
  • Commenter
  • Leader
  • 24 Month Streak
  • Thankful Level 5
  • Most Accepted 2022
  • Revival Level 4
  • Knowledgeable Level 5
  • Promoter

View badges

Feeds

View by

Answered
While Loop not running
This loop will never terminate if entered while Close>L_entry_price==false; i=i+1; end because only i changes. Close and...

34 minutes ago | 0

Answered
How to calculate maximum distance between two points (coordinates) on a XY (2D) plane ?
"seem to be the largest distance" Seems to be, but it's not. The x-scale and y-scale are not quite the same. Use axis equal t...

1 hour ago | 1

| accepted

Answered
How do structures work?
To create a scalar (as opposed to a 0x0) structure array, this 'AllSampleRates', {},... needs to be 'AllSampleRates', {{}},.....

4 hours ago | 0

Answered
Unable to perform assignment because the size of the left side is 1-by-2 and the size of the right side is 1-by-3. Error in pso_process_svc (line 31)
Looks like the function limit_chk_process2 returns a 1x3 vector, but you are expecting it to return a 1x2 vector.

4 hours ago | 0

Answered
plotting a 3d graph for a 3d table
M = readmatrix('file.xlsx') x = M(2:end,2); y = M(1,3:end); z = M(2:end,3:end); figure surf(x,y,z.')

4 hours ago | 0

| accepted

Answered
I tried this code but it gives me an error
u appears to be in degrees, but phi_n appears to be in radians. You need to convert one or the other, and then use the appropria...

5 hours ago | 0

| accepted

Answered
Find data from txt file
filename = 'file1.txt'; dt = str2double(regexpi(fileread(filename),'dt. (.*) sec','tokens','once')) filename = 'file2.txt'; d...

6 hours ago | 0

Answered
Find a smaller matrix within a larger matrix
small = 2:7; big = [randi(10,2,15); 2:16; 2:7 10 12 13 15 16 19 20 22 23; randi(10,3,15)] idx = cellfun(@(row)~isempty(strfi...

7 hours ago | 1

Answered
The function's input parameter must be a vector or matrix, and the function must add 1 to each element of the input parameter.
If the task were to write a function that multiplies each element of a vector or matrix (or any array) by 2, then a solution mig...

15 hours ago | 0

Answered
I'm trying to convert the text into binary and then i want to make the 4 bits chunks.
Is this what you are going for? message = 'Hello world'; A = dec2bin(message, 8); cc = reshape(A.',1,[])

16 hours ago | 0

Answered
Merging 2 plots that are already saved as .fig files
Something like this might work, assuming each figure has one axes: fig1 = openfig('File1.fig','invisible'); fig2 = openfig('Fi...

22 hours ago | 0

| accepted

Answered
colorbar label along y-axis instead of x-axis
% generate random data: lon = 0:359; lat = -90:90; tmp2 = 217+96*rand(numel(lat),numel(lon)); contourf(lon,lat,tmp2, 25, '...

1 day ago | 0

Answered
While Loops and Criteria
I'm not sure why it's always randi(4), when the matrices all have 9 rows. Are you constrained to pulling from only the first 4 r...

1 day ago | 0

| accepted

Answered
How can I get my script to calculate the average correctly?
Are you sure you want to take the mean over the second dimension here? % Calculate average depth and average load for each row ...

1 day ago | 0

Answered
why can't I use uitable to display a table on a figure?
A uitable's Data cannot be a table variable if the uitable is in a figure created with the figure function. See the description ...

1 day ago | 0

| accepted

Answered
Why is my figure different when I open it in the Figure Window, compared to that displayed in the results pane of Live Script?
Try saving the uifigure directly at the end of your code: fig_filename = 'output.fig'; % change this to what/where the .fig fil...

1 day ago | 0

Answered
In app designer, I have a random number generated that is assigned to a variable. If the number is 1, I want the user to be able to choose the value of this variable: 1 or 11
p = [p1 p2]; for ii = [1 2] if p(ii) == 1 while true answer = questdlg('You have drawn an ace! Pleas...

1 day ago | 1

Answered
I have an error with this code for different number of elements. I'm lost on how to fix it for the proper output.
Transpose the (0:N-1) vector, because you want a column vector, in order to be consistent with the shape of the data variable, w...

1 day ago | 0

| accepted

Answered
figure is not being displayed
All the plots in the 2nd, 3rd, and 4th figures are based on scalars. Plotting a scalar is plotting a single point, so it's not g...

3 days ago | 0

Answered
Need help to run the Matlab code
"No. of Bees" must be a positive even number. "Dim" mut be 1 or 2. "Iteration" must be a positive integer. "Run" must be a posit...

3 days ago | 0

| accepted

Answered
how to plot directly from value in app designer?
Assuming those are numeric edit fields called "InsEdit1", "InsEdit2", ..., and "TimeEdit1", "TimeEdit2", ..., then here's one wa...

3 days ago | 0

Answered
My pie chart wont show up
I assume the problem is that your code calls plotCostBreakdown when it should call costBreakdown (or that the costBreakdown func...

3 days ago | 0

Answered
Do calculations in csv data one csv file at the time
Something like this; adjust as necessary. % use dir() to get info about the relevant csv files: csv_dir = '.'; F = dir(fullfi...

3 days ago | 0

| accepted

Answered
How to write the sum of several matrices in Matlab ?
A = sum(B,3);

3 days ago | 0

Answered
'Text' must be character vector issue in app designer
You can store the buttons in an array (not a cell array), and you don't need to put x in a cell array either. Also, reshape is n...

4 days ago | 1

| accepted

Answered
Matrix dimensions must agree
Read the descriptions on the pcolor documentation page for X, Y, and C - specifically how their sizes must be related. Then che...

4 days ago | 0

Answered
Fill function not accepting hexadecimal colors
A = [2 2 4 4]; B = [5 3 3 5]; patch("XData",A,"YData",B,"FaceColor","#0000FF");

4 days ago | 0

| accepted

Answered
How can I extract an array of numbers from a text-formatted cell array of strings.
data = { '20s' '15m' '' '24s' '' '44s' '3h' '40m' '20s' '' '14s' }; ...

4 days ago | 0

Answered
How to Convert a Scalar Struct with Vector Fields to a Vector Struct with Scalar Fields?
S.x = [1 2]; S.y = [10 20]; N = numel(S.x); f = fieldnames(S); NF = numel(f); clear A A(N) = S; for ii = 1:N for...

5 days ago | 0

Answered
How to Convert a Scalar Struct with Vector Fields to a Vector Struct with Scalar Fields?
S.x = [1 2]; S.y = [10 20]; C = [fieldnames(S) , cellfun(@num2cell,struct2cell(S),'Uni',false)].'; A = struct(C{:}) [A.x] ...

5 days ago | 0

Load more