New answers tagged

4

The syntax you use is wrong. There is no import element called "P" for the MAT format. Take a look at the documentation: it lists the allowed elements: "Elements", "Rules", "Options", "Data", "LabeledData", "Comments", "Labels". You probably want "LabeledData", so use Import["file.mat", {"MAT", "LabeledData"}] or alternatively Import["file.mat", ...


2

Here is what I get when I try your equation: a = 1; b = 0.2; c = 4; y0 = 8.5; v0 = 0; DSolve[{a y''[t] + b y'[t] + c y[t] == 0, y[0] == y0, y'[0] == v0}, y[t], t] (* {{y[t] -> 8.5 E^(-0.1 t) (1. Cos[1.9975 t] + 0.0500626 Sin[1.9975 t])}} *) You may need to restart your kernel and try again.


2

data = {{8.5, 8.6, 8.9, 9.5}, {"a", "b", "c", "d"}}; bcdata = # -> RandomReal[.5] & /@ data[[1]]; bc = BarChart[bcdata, ChartLabels -> Placed[data[[2]], Axis], ChartElementFunction -> errorBar[], PlotRange -> {8, 10}, ImageSize -> 500, ImagePadding -> 15] To crop the bottom of the bars: modifyF@bc where the functions ...


2

I'm not sure how is it simple, but something like this should work. As a bonus you can change bar width. Needs["ErrorBarPlots`"] prepData[data_, size_] := {{#2 - size/2, 0}, {#2 - size/2, #1}, {#2 + size/2, #1}, {#2 + size/2, 0}} & @@@ MapIndexed[{#1, First@#2} &, data] // Flatten[#, 1] & data = {{8.5, 8.6, 8.9, 9.5}, {"a", "b", ...


2

Code: ClearAll["Global`*"]; gau[x_, v_] := Exp[-(x^2)/(2 v)]/Sqrt[2*Pi*v]; f[x_, m_, v_] = gau[x + m, v] + gau[x - m, v]; g[x_, m_, v_] = gau[x + m, v] - gau[x - m, v]; h[x_, m_, v_] := 2*Log[f[x, m, v]/f[0, m, v]] + (x^2)/v + 6 x*g[x, m, v]/f[x, m, v]; Plot[h[x, 3, 1], {x, 0, 3}] Example: *.png example Export["example1.png",Plot[h[x, 3, 1], {x, 0, 3}]] ...


1

I don't know if it's a bug, but Mathematica makes a move that, when it's your student you say, why did you do that! It was simpler before. I ran this code without the replacement with Exp[stuff__ * C[1]] in order to figure out what to do to fix it. (The colored output below are from the Print statements showing the various calls to Solve that happen inside ...


0

I changed "Date and time setting" in my PC. then it works, (All Entity-Based object)


7

I know this is an old question, but I ran into this problem myself. The permanent solution for me was to alter the settings of JLink directly. As for most commenters too, increasing the heap-space by giving commandline options to ReinstallJava and friends didn't work. Specifically, I tried to increase the heap-space by specifying the complete CommandLine ...



Top 50 recent answers are included