Community Profile

photo

Jon


Last seen: 9 days ago Active since 2013

Statistics

  • Guiding Light
  • 6 Month Streak
  • Knowledgeable Level 5
  • Revival Level 1
  • First Review
  • Thankful Level 3
  • First Answer

View badges

Content Feed

View by

Question


What is a simple way to check if a collection of vectors all have the same number of elements
I am look for a nice simple way to check if a collection of vectors all have the same number of elements. For example this migh...

8 days ago | 2 answers | 0

2

answers

Answered
Concatenate two structures from a starting point
I think this example shows how to do what you are asking for % Make some example data d1 = datetime(2023,1,10):days(1):datetim...

8 days ago | 0

Answered
why am I getting the error "Incorrect number or types of inputs or outputs for function 'step."
This runs for me in R2023b, what version are you running? If I look at the actual step.m file in my directory, which comes up as...

9 days ago | 0

Answered
Change variables in the base workspace through a Matlab Function block
I would suggest using the "Interpreted MATLAB Function" block for this purpose. It doesn't need to get compiled. It is under Si...

9 days ago | 2

Answered
Identifying regions in matrix rows
I wasn't completely clear from your description what output you wanted, but I think this is what you were looking for. Still lo...

12 days ago | 1

Answered
How to make Simulink read a MatLab variable every 5 seconds?
You can do this using the set_param function. I have attached an example Simulink model and script you can run to demonstrate th...

17 days ago | 2

| accepted

Answered
Why does it take MATLAB so long to print hello world?
I'm not sure how you are running your test, running this script inside this online environment seems to indicate it is very f...

24 days ago | 0

Answered
row ranking among multiple matrices
Similar to @Bruno Luong, but since I already coded up example before I saw @Bruno Luong's I will provide it as alternative here ...

1 month ago | 1

Answered
How to extract and to export to Excel some variables that have been logged using To Workspace block?
There are many ways to do this. I have attached a simple example showing one way to do it with the data being saved in timeserie...

1 month ago | 1

| accepted

Answered
"Insufficient number of outputs from right hand side of equal sign to satisfy assignment." in Simulink
I found that if I changed the "Simulate using" parameter on the DUC from Code Generation to Interpreted execution, the model ra...

2 months ago | 0

Answered
Scatter plot with variable symbol size - it's not linear
According to the documentation for scatter, the size in "points squared" units, try this x = 1:100; y = ones( size(x) ); scat...

2 months ago | 0

| accepted

Answered
Delete rows from a table below a certain threshold
% Make up some example data Time = [1:10]'; Data = randn(10,1)*10; Table = cat(2,Time,Data) Threshold = 8; % Delete rows ...

2 months ago | 0

Answered
FFT of bearing signal
In the attached code, I independently calculated the spectrum and compared to your calculation. It seems correct that your data ...

2 months ago | 0

| accepted

Answered
Use files from multiple folders
Yes, this is possible. You can either open the file using the full path to the file, for example im = imread('c:/mystuff/myvid...

2 months ago | 1

Answered
Multiple dropdown inputs to narrow down file options in App Designer
I have attached a very simple example of how you might have the choice from one drop down menu change the possible choices from ...

2 months ago | 0

| accepted

Answered
trying to find a linear combination of matrixes in order to minimize the error between the linear combination and a target matrix
Here's a much more elaborate approach that can be modified to use a specific choice of matrix norm to be minimized. I would use ...

2 months ago | 0

Answered
How to Implement 3rd order equation in matlab script?
I would do it something like this: function ival = ifun(theta,psi) % Define constants K2 = 25; % just for example, you put in...

2 months ago | 0

| accepted

Answered
Plotting array filtered by column?
So to make @Dyuman Joshi suggestion more concrete % Define example points A = [ 1.0000 1.0000 5.5000 1.0000 ...

2 months ago | 0

| accepted

Answered
Can I use ismembertol to find x,y coordinates that are close to each other?
If I am understanding what you are trying to do correctly I think this would do what you ask % Define some example coordinates ...

2 months ago | 0

Answered
Search for files in directory, and use file name to input data
I think this example shows you how you could solve your problem % Find all of the relevant files % for this example I used Exc...

3 months ago | 0

Answered
FIFO push all values as vector
I assume you are using the Queue block in the DSP System Toolbox in Simulink. If so you should supply the In port with a 5 ele...

3 months ago | 0

| accepted

Answered
Does the resample function do sinc interpolation before resampling?
It sounds like you are not resampling at a new frequency (the main purpose of resample) but instead creating samples of a delaye...

3 months ago | 0

Answered
Error due to integration
I don't have your Excel file to test your code, but it looks like your problem is that the function given to integral, in your c...

3 months ago | 0

Answered
How to rename identical variables under one common name?
Here's a general way to handle this. Note no need for all those if statements % Read in the data T = readtable('myData.xlsx');...

3 months ago | 0

Answered
How to sort a cell array with respect to another cell array?
cellA = {'A', 'B', 'C', 'D'; 1, 2, 3, 4; 5, 6, 7, 8; 9, 1, 2, 3} cellB = {'C', 'A', 'D'; 1, 2, 3; 4, 5, 6; 7, 8, 9} [lia,lib] ...

3 months ago | 2

Answered
Can't connect to database when the servername has a backslash in it
There may be a much cleaner way to deal with this. I'm not sure of the details of why you get this error. Are you on a windows m...

3 months ago | 0

Answered
How to combine two graph from two function in another script?
Example Run script 1 % Script 1 % define first curve t1 = linspace(0,5); y1 = t1 + 2*t1.^2; Run script 2 % Script 2 % de...

3 months ago | 0

| accepted

Answered
How to find the intersection of two curves with the input data being two vectors?
Here is an example of one way to do this, you would have to put in the data for your curves, I just made up two curves for this ...

3 months ago | 0

Question


How to implement arrays of events and listeners
I would like to be able to apply the event - listener methodology to obtain notification when specified, individual elements of...

3 months ago | 1 answer | 0

1

answer

Answered
How to parse webpage JSON with temperatures in it.
You can use webread data = webread('https://api.meteo.lt/v1/stations/vilniaus-ams/observations/2023-06-21')

3 months ago | 0

| accepted

Load more