답변 있음
How can I see and modify frames in a filename.mat?
I assume, that ypu want to show e.g. the frame corresponding to a certain value of tvec. Remember, that comparisons of floating...

대략 4년 전 | 1

답변 있음
How to find the intersection points of a plot that contains multiple straight lines?
N = 5; %number of spawns X1 = rand(1,N) - 0.5; X2 = X1; Y1 = rand(1,N) - 0.5; Y2 = Y1; D = pi * rand(1,N) - pi/2; sD = si...

대략 4년 전 | 0

| 수락됨

답변 있음
Invalid expression, check for mismatched delimiters. Trying to form a matrix using brackets.
What is the meaning of this line: fabcr=mag.(cos(ang)+jsin(ang)); This treats "mag" as a struct and tries to interprete "cos(a...

대략 4년 전 | 1

| 수락됨

답변 있음
Can anyone help me optimize the if statements in For loops to make the code faster?
The loops look fine. I'd omit the J=triu(J_org), because you use the upper triangle only inside the code Vectorizing the inner ...

대략 4년 전 | 1

| 수락됨

답변 있음
I have a 4x4 array of 1's and I need to turn 3 of 4 ones to zero per row at random. So there will be a one 1 left in each row.
Instead of starting with ones and set all but one to zero, it is cheaper to start with zeros and set one element to 1 per row: ...

대략 4년 전 | 0

| 수락됨

답변 있음
How do I do an if greater than or less than for a if statement
if f <= -8 || f >= 8 error('f is outside the valid range') end Alternative: if abs(f) >= 8

대략 4년 전 | 0

답변 있음
Generate array with a specified number of random songs from folder
piesele = {'1.mp3'; '2.mp3'; '3.mp3'; '4.mp3'; '5.mp3'; '6.mp3'; '7.mp3'; '8.mp3'; '9.mp3'; '10.mp3';... '11.mp3'; '12.mp3'...

대략 4년 전 | 0

| 수락됨

답변 있음
Sorting rows into colums
A = rand(1020, 12); B = reshape(A.', 120, 12);

대략 4년 전 | 0

| 수락됨

답변 있음
Get many numbers out of a file
What about: B_key = 'B'; % Or maybe: sprintf('\nB\n') C_key = 'C'; % Or maybe: sprintf('\nC\n') Str = fileread('exampl...

대략 4년 전 | 1

| 수락됨

답변 있음
Remove menubar from a figure BUT leaving the toolbar
You mention the toolbar of the axes. This should not disappear if you remove the toolbar of the figure. Which Matlab version ar...

대략 4년 전 | 0

답변 있음
Setting box size in Figure
You can set the position (including the dimensions) of an axes as the "Position" (this is the InnerPosition), "TighInset" or "Ou...

대략 4년 전 | 0

| 수락됨

답변 있음
Correct way to fetch data from a GUI with nested menus.
These lines define ComponentA and ComponentB as globals: global ComponentA; global ComponentB; The you do not use them as glo...

대략 4년 전 | 2

| 수락됨

답변 있음
Matlab not running from shell script (Ubuntu 18.04LTS)
Try this from the shell of the operating system: matlab matlab -nodisplay -nosplash -nodesktop matlab -nosplash -r "isfil...

대략 4년 전 | 0

답변 있음
How to control the variation speed of a generated random signal ?
Start with sorting the random values. Then mix the result partially: x = rand(1, 500); y = sort(x); z1 = [y(1:2:500), flip(y...

대략 4년 전 | 0

답변 있음
Using addlistener function - how to output values from event handler?
function eventhandlerChanged(source,arg) % Open and read text file [f_ID, msg] = fopen('c:\work\temp\text_file.txt','r'); ass...

대략 4년 전 | 1

| 수락됨

답변 있음
When does R2016b (MATLAB 9.1) go end of support/ end of life
How do you define "life"? I run Matlab 6.5 successfully in a virtual machine under WindowsXP. MathWorks has published the last ...

대략 4년 전 | 0

답변 있음
Can someone explain why in this code f3 and f2 are equal to (1048576,2)?
You mean: f3 = zeros(1048576,2); f2 = zeros(1048576,2); Here the variables f2 and f3 are defines as matrices with the dimensi...

대략 4년 전 | 1

답변 있음
Create a Single Array From 3 different one
I'm not sure what "going row by row" means. Maybe x = rand(14, 4); y = rand(14, 4); z = rand(14, 4); xt = x.'; yt = y.'; ...

대략 4년 전 | 1

답변 있음
How to create double with label name respectively
Do not hide an index in the name of a set of variables. If you need a set of variables, use an array instead. Creating variables...

대략 4년 전 | 0

답변 있음
interpret a simple matrix code
I recommend to use the free Matlab tutorials to learn the basics: https://www.mathworks.com/learn/tutorials/matlab-onramp.html ...

대략 4년 전 | 0

| 수락됨

답변 있음
Calculate the volume of a body
x1 = [-0.5, 3.90]; y1 = [-0.5, 3.70]; x2 = [-3.90, 0.5]; y2 = [-3.70, 0.5]; axes('NextPlot', 'add'); line(x1([1,1,2,2,1])...

대략 4년 전 | 1

답변 있음
How to create price weighted index function?
Start with using Matlab methods instead of the loops: avg = AvgPrice2019; meanAavg = sum(avg); pweight = avg / meanAvg;...

대략 4년 전 | 0

| 수락됨

답변 있음
Can someone help me understand why I cant get a graph with an alpha of 0.001
With alpha = 0.1 only the 3rd case of the if-branches occurs. Then dxdt is replied as [3 x 1] vector. With alpha = 0.001 the fi...

대략 4년 전 | 1

답변 있음
How do I verify if a structure array is a subset of another structure array
You have to write your own tool to test for your definition of a struct-subset. Maybe: % [UNTESTED CODE] function T = isStruct...

대략 4년 전 | 0

| 수락됨

답변 있음
please help, how can i create the following matrix? 𝒂 = ( 𝒆 𝟏 𝒏 𝒏 𝒎 𝒆 𝟐 𝒏 𝒎 𝒎 𝒆 𝟑 ⋯ 𝒏 𝒏 𝒏 𝒏 𝒏 𝒏 ⋮ ⋱ ⋮ 𝒎 𝒎 𝒎 ⋯ 𝒆 𝒏 𝒏)
Use the functions triu, diag and tril . Another option is to start with zeros(m, n) and running 2 for loops. Then compare the i...

대략 4년 전 | 0

답변 있음
how to store the conditional loop data
Your cleaned code: ut = rand(15, 1); uy = [0.84; 0.384; 0.784]; U_y = repmat(uy, 5, 1); for n = 1:15 if ut(n) > U_y(n...

대략 4년 전 | 0

답변 있음
Sorting a BigInteger array
How dod you create the array? Please post a short example. I seems that you are talking about a Java class, not a Matlab array. ...

대략 4년 전 | 0

| 수락됨

답변 있음
Matrix or vector operation faster?
The number of multiplications is the same in both versions, as far as I can see. So I'd expect both to need almost the same time...

대략 4년 전 | 0

| 수락됨

답변 있음
Populate a 1000x1000 array with rows where a value is added every second, then third etc. column
You want an output of size 1000x1000: M = zeros(1000, 1000); You want a loop to go from 1 to 1000: for k = 1:1000 ... e...

대략 4년 전 | 1

| 수락됨

답변 있음
How can I import "curl" API in MATLAB using webread function?
What about using curl instead? This is included in Linux, MacOS and Windows also: system(['curl "https://www.sapsailing.com/sai...

대략 4년 전 | 1

| 수락됨

더 보기